# if defined(__FreeBSD__)
# define _LIBCPP_HAS_ALIGNED_ALLOC
# define _LIBCPP_HAS_QUICK_EXIT
-# define _LIBCPP_HAS_C11_FEATURES
# if __FreeBSD_version >= 1300064 || \
(__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000)
# define _LIBCPP_HAS_TIMESPEC_GET
# endif
# elif defined(__BIONIC__)
-# define _LIBCPP_HAS_C11_FEATURES
# if __ANDROID_API__ >= 21
# define _LIBCPP_HAS_QUICK_EXIT
# endif
# define _LIBCPP_HAS_ALIGNED_ALLOC
# define _LIBCPP_HAS_QUICK_EXIT
# define _LIBCPP_HAS_TIMESPEC_GET
-# define _LIBCPP_HAS_C11_FEATURES
# elif defined(__linux__)
# if !defined(_LIBCPP_HAS_MUSL_LIBC)
# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
# endif
# if _LIBCPP_GLIBC_PREREQ(2, 17)
# define _LIBCPP_HAS_ALIGNED_ALLOC
-# define _LIBCPP_HAS_C11_FEATURES
# define _LIBCPP_HAS_TIMESPEC_GET
# endif
# else // defined(_LIBCPP_HAS_MUSL_LIBC)
# define _LIBCPP_HAS_ALIGNED_ALLOC
# define _LIBCPP_HAS_QUICK_EXIT
# define _LIBCPP_HAS_TIMESPEC_GET
-# define _LIBCPP_HAS_C11_FEATURES
# endif
# endif // __linux__
#endif
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+
+// Make sure TEST_HAS_ALIGNED_ALLOC (defined by the test suite) and
+// _LIBCPP_HAS_ALIGNED_ALLOC (defined by libc++) stay in sync.
+
+#include <__config>
+#include "test_macros.h"
+
+#if defined(TEST_HAS_ALIGNED_ALLOC) != defined(_LIBCPP_HAS_ALIGNED_ALLOC)
+# error "TEST_HAS_ALIGNED_ALLOC and _LIBCPP_HAS_ALIGNED_ALLOC are out of sync"
+#endif
+++ /dev/null
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14
-
-// We have two macros for checking whether or not the underlying C library
-// has C11 features:
-// TEST_HAS_C11_FEATURES - which is defined in "test_macros.h"
-// _LIBCPP_HAS_C11_FEATURES - which is defined in <__config>
-// They should always be the same
-
-#include <__config>
-#include "test_macros.h"
-
-#ifdef TEST_HAS_C11_FEATURES
-# ifndef _LIBCPP_HAS_C11_FEATURES
-# error "TEST_HAS_C11_FEATURES is defined, but _LIBCPP_HAS_C11_FEATURES is not"
-# endif
-#endif
-
-#ifdef _LIBCPP_HAS_C11_FEATURES
-# ifndef TEST_HAS_C11_FEATURES
-# error "_LIBCPP_HAS_C11_FEATURES is defined, but TEST_HAS_C11_FEATURES is not"
-# endif
-#endif
-
-int main(int, char**) {
- return 0;
-}
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+
+// Make sure TEST_HAS_QUICK_EXIT (defined by the test suite) and
+// _LIBCPP_HAS_QUICK_EXIT (defined by libc++) stay in sync.
+
+#include <__config>
+#include "test_macros.h"
+
+#if defined(TEST_HAS_QUICK_EXIT) != defined(_LIBCPP_HAS_QUICK_EXIT)
+# error "TEST_HAS_QUICK_EXIT and _LIBCPP_HAS_QUICK_EXIT are out of sync"
+#endif
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+
+// Make sure TEST_HAS_TIMESPEC_GET (defined by the test suite) and
+// _LIBCPP_HAS_TIMESPEC_GET (defined by libc++) stay in sync.
+
+#include <__config>
+#include "test_macros.h"
+
+#if defined(TEST_HAS_TIMESPEC_GET) != defined(_LIBCPP_HAS_TIMESPEC_GET)
+# error "TEST_HAS_TIMESPEC_GET and _LIBCPP_HAS_TIMESPEC_GET are out of sync"
+#endif
#error FLT_RADIX not defined
#endif
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
+#if TEST_STD_VER > 14 && 0
#ifndef FLT_HAS_SUBNORM
#error FLT_HAS_SUBNORM not defined
#endif
#error DECIMAL_DIG not defined
#endif
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
+#if TEST_STD_VER > 14 && 0
#ifndef FLT_DECIMAL_DIG
#error FLT_DECIMAL_DIG not defined
#endif
#error LDBL_MIN not defined
#endif
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
+#if TEST_STD_VER > 14 && 0
#ifndef FLT_TRUE_MIN
#error FLT_TRUE_MIN not defined
#endif
#error FLT_RADIX not defined
#endif
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
+#if TEST_STD_VER > 14 && 0
#ifndef FLT_HAS_SUBNORM
#error FLT_HAS_SUBNORM not defined
#endif
#error DECIMAL_DIG not defined
#endif
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
+#if TEST_STD_VER > 14 && 0
#ifndef FLT_DECIMAL_DIG
#error FLT_DECIMAL_DIG not defined
#endif
#error LDBL_MIN not defined
#endif
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) && 0
+#if TEST_STD_VER > 14 && 0
#ifndef FLT_TRUE_MIN
#error FLT_TRUE_MIN not defined
#endif
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
// UNSUPPORTED: c++03
-// test that referencing at_quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined
+// test that referencing at_quick_exit when TEST_HAS_QUICK_EXIT is not defined
// results in a compile error.
#include <cstdlib>
-void f() {}
+#include "test_macros.h"
-int main(int, char**)
-{
-#ifndef _LIBCPP_HAS_QUICK_EXIT
+void f() { }
+
+int main(int, char**) {
+#if !defined(TEST_HAS_QUICK_EXIT)
std::at_quick_exit(f);
#else
-#error
+# error
#endif
-
- return 0;
+ return 0;
}
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
+
// UNSUPPORTED: c++03
-// test that referencing quick_exit when _LIBCPP_HAS_QUICK_EXIT is not defined
+// test that referencing quick_exit when TEST_HAS_QUICK_EXIT is not defined
// results in a compile error.
#include <cstdlib>
-void f() {}
+#include "test_macros.h"
-int main(int, char**)
-{
-#ifndef _LIBCPP_HAS_QUICK_EXIT
+int main(int, char**) {
+#if !defined(TEST_HAS_QUICK_EXIT)
std::quick_exit(0);
#else
-#error
+# error
#endif
-
- return 0;
+ return 0;
}
int main(int, char**)
{
-#ifdef _LIBCPP_HAS_QUICK_EXIT
+#ifdef TEST_HAS_QUICK_EXIT
std::at_quick_exit(f);
std::quick_exit(0);
#endif
// MSVC doesn't have __int128_t.
#define _LIBCPP_HAS_NO_INT128
-// MSVC has quick_exit() and at_quick_exit().
-#define _LIBCPP_HAS_QUICK_EXIT
-
#ifndef _LIBCXX_IN_DEVCRT
// atomic_is_lock_free.pass.cpp needs this VS 2015 Update 2 fix.
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
// Specifically, FreeBSD does NOT have timespec_get, even though they have all
// the rest of C11 - this is PR#38495
# define TEST_HAS_ALIGNED_ALLOC
-# define TEST_HAS_C11_FEATURES
+# define TEST_HAS_QUICK_EXIT
# elif defined(__BIONIC__)
-# define TEST_HAS_C11_FEATURES
+# if __ANDROID_API__ >= 21
+# define TEST_HAS_QUICK_EXIT
+# endif
# if __ANDROID_API__ >= 28
# define TEST_HAS_ALIGNED_ALLOC
# endif
# define TEST_HAS_TIMESPEC_GET
# endif
# elif defined(__Fuchsia__) || defined(__wasi__) || defined(__NetBSD__)
+# define TEST_HAS_QUICK_EXIT
# define TEST_HAS_ALIGNED_ALLOC
-# define TEST_HAS_C11_FEATURES
# define TEST_HAS_TIMESPEC_GET
# elif defined(__linux__)
// This block preserves the old behavior used by include/__config:
// available. The configuration here may be too vague though, as Bionic, uClibc,
// newlib, etc may all support these features but need to be configured.
# if defined(TEST_GLIBC_PREREQ)
+# if TEST_GLIBC_PREREQ(2, 15)
+# define TEST_HAS_QUICK_EXIT
+# endif
# if TEST_GLIBC_PREREQ(2, 17)
# define TEST_HAS_ALIGNED_ALLOC
# define TEST_HAS_TIMESPEC_GET
-# define TEST_HAS_C11_FEATURES
# endif
# elif defined(_LIBCPP_HAS_MUSL_LIBC)
+# define TEST_HAS_QUICK_EXIT
# define TEST_HAS_ALIGNED_ALLOC
-# define TEST_HAS_C11_FEATURES
# define TEST_HAS_TIMESPEC_GET
# endif
# elif defined(_WIN32)
# if defined(_MSC_VER) && !defined(__MINGW32__)
+# define TEST_HAS_QUICK_EXIT
# define TEST_HAS_ALIGNED_ALLOC
-# define TEST_HAS_C11_FEATURES // Using Microsoft's C Runtime library
# define TEST_HAS_TIMESPEC_GET
# endif
# endif