diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -55,6 +55,7 @@ condition_variable csetjmp csignal + cstdalign cstdarg cstdbool cstddef diff --git a/libcxx/include/cstdalign b/libcxx/include/cstdalign new file mode 100644 --- /dev/null +++ b/libcxx/include/cstdalign @@ -0,0 +1,30 @@ +// -*- C++ -*- +//===--------------------------- cstdalign --------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_CSTDALIGN +#define _LIBCPP_CSTDALIGN + +/* + cstdalign synopsis + +Macros: + + __alignas_is_defined + +*/ + +#include <__config> +#include + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +#endif // _LIBCPP_CSTDALIGN diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap --- a/libcxx/include/module.modulemap +++ b/libcxx/include/module.modulemap @@ -161,7 +161,10 @@ header "csignal" export * } - // FIXME: is missing. + module cstdalign { + header "cstdalign" + export * + } module cstdarg { header "cstdarg" export * diff --git a/libcxx/test/libcxx/double_include.sh.cpp b/libcxx/test/libcxx/double_include.sh.cpp --- a/libcxx/test/libcxx/double_include.sh.cpp +++ b/libcxx/test/libcxx/double_include.sh.cpp @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include diff --git a/libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp b/libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +#include + +#include "test_macros.h" + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main(int, char**) +{ + + return 0; +} diff --git a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp --- a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp +++ b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp @@ -96,6 +96,8 @@ TEST_MACROS(); #include TEST_MACROS(); +#include +TEST_MACROS(); #include TEST_MACROS(); #include diff --git a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp --- a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp +++ b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include diff --git a/libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp b/libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// test + +// This header was removed in C++20 +// REQUIRES: c++03 || c++11 || c++14 || c++17 + +#include + +#ifdef alignas +#error alignas should not be a macro in C++ +#endif + +#ifndef __alignas_is_defined +#error __alignas_is_defined not defined +#endif + +int main(int, char**) { + + return 0; +}