[libcxx-commits] [PATCH] D119865: [libc++][nfc] Add TEST_HAS_NO_STRONG_ENUMS.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 15 10:20:38 PST 2022


Mordante created this revision.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This avoids using an libc++ internal macro in our tests. This version
doesn't depend on the internal macro but redefines it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119865

Files:
  libcxx/test/std/thread/futures/futures.overview/launch.pass.cpp
  libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp
  libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp
  libcxx/test/support/test_macros.h


Index: libcxx/test/support/test_macros.h
===================================================================
--- libcxx/test/support/test_macros.h
+++ libcxx/test/support/test_macros.h
@@ -394,6 +394,10 @@
 #  define TEST_HAS_NO_FGETPOS_FSETPOS
 #endif
 
+#if !(__has_feature(cxx_strong_enums))
+#  define TEST_HAS_NO_STRONG_ENUMS
+#endif
+
 #if defined(__GNUC__)
 #pragma GCC diagnostic pop
 #endif
Index: libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp
===================================================================
--- libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp
+++ libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp
@@ -26,7 +26,7 @@
     big = 0xFFFFFFFFFFFFFFFFULL
 };
 
-#if !defined(TEST_HAS_NO_INT128) && !defined(_LIBCPP_HAS_NO_STRONG_ENUMS)
+#if !defined(TEST_HAS_NO_INT128) && !defined(TEST_HAS_NO_STRONG_ENUMS)
 enum HugeEnum : __int128_t
 {
     hugezero
@@ -63,7 +63,7 @@
 #ifndef TEST_HAS_NO_INT128
     test_make_unsigned<__int128_t, __uint128_t>();
     test_make_unsigned<__uint128_t, __uint128_t>();
-# ifndef _LIBCPP_HAS_NO_STRONG_ENUMS
+#  ifndef TEST_HAS_NO_STRONG_ENUMS
     test_make_unsigned<HugeEnum, __uint128_t>();
 # endif
 #endif
Index: libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp
===================================================================
--- libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp
+++ libcxx/test/std/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp
@@ -26,7 +26,7 @@
     big = 0xFFFFFFFFFFFFFFFFULL
 };
 
-#if !defined(TEST_HAS_NO_INT128) && !defined(_LIBCPP_HAS_NO_STRONG_ENUMS)
+#if !defined(TEST_HAS_NO_INT128) && !defined(TEST_HAS_NO_STRONG_ENUMS)
 enum HugeEnum : __uint128_t
 {
     hugezero
@@ -62,7 +62,7 @@
 #ifndef TEST_HAS_NO_INT128
     test_make_signed< __int128_t, __int128_t >();
     test_make_signed< __uint128_t, __int128_t >();
-# ifndef _LIBCPP_HAS_NO_STRONG_ENUMS
+#  ifndef TEST_HAS_NO_STRONG_ENUMS
     test_make_signed< HugeEnum, __int128_t >();
 # endif
 #endif
Index: libcxx/test/std/thread/futures/futures.overview/launch.pass.cpp
===================================================================
--- libcxx/test/std/thread/futures/futures.overview/launch.pass.cpp
+++ libcxx/test/std/thread/futures/futures.overview/launch.pass.cpp
@@ -24,7 +24,7 @@
 
 int main(int, char**)
 {
-#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
+#ifdef TEST_HAS_NO_STRONG_ENUMS
    LIBCPP_STATIC_ASSERT(static_cast<int>(std::launch::any) ==
                  (static_cast<int>(std::launch::async) | static_cast<int>(std::launch::deferred)), "");
 #else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119865.408956.patch
Type: text/x-patch
Size: 2691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220215/614293ca/attachment.bin>


More information about the libcxx-commits mailing list