[libcxx-commits] [libcxx] f46bb9d - [NFC] Reformat TEST_FOO macros in test_macros.h

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 27 13:54:50 PDT 2020


Author: Louis Dionne
Date: 2020-05-27T16:54:43-04:00
New Revision: f46bb9dd5ca0b5b553590da5ff177767be0b75b5

URL: https://github.com/llvm/llvm-project/commit/f46bb9dd5ca0b5b553590da5ff177767be0b75b5
DIFF: https://github.com/llvm/llvm-project/commit/f46bb9dd5ca0b5b553590da5ff177767be0b75b5.diff

LOG: [NFC] Reformat TEST_FOO macros in test_macros.h

To make them easier to read and to make it easier to add new ones.

Added: 
    

Modified: 
    libcxx/test/support/test_macros.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 6cbb7f0ccc16..79ee5ddace8c 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -118,41 +118,41 @@
 #endif
 
 #if TEST_STD_VER >= 11
-#define TEST_ALIGNOF(...) alignof(__VA_ARGS__)
-#define TEST_ALIGNAS(...) alignas(__VA_ARGS__)
-#define TEST_CONSTEXPR constexpr
-#define TEST_NOEXCEPT noexcept
-#define TEST_NOEXCEPT_FALSE noexcept(false)
-#define TEST_NOEXCEPT_COND(...) noexcept(__VA_ARGS__)
-# if TEST_STD_VER >= 14
-#   define TEST_CONSTEXPR_CXX14 constexpr
-# else
-#   define TEST_CONSTEXPR_CXX14
-# endif
-# if TEST_STD_VER > 14
-#   define TEST_THROW_SPEC(...)
-# else
-#   define TEST_THROW_SPEC(...) throw(__VA_ARGS__)
-# endif
-# if TEST_STD_VER > 17
-#   define TEST_CONSTEXPR_CXX20 constexpr
-# else
-#   define TEST_CONSTEXPR_CXX20
-# endif
+# define TEST_ALIGNOF(...) alignof(__VA_ARGS__)
+# define TEST_ALIGNAS(...) alignas(__VA_ARGS__)
+# define TEST_CONSTEXPR constexpr
+# define TEST_NOEXCEPT noexcept
+# define TEST_NOEXCEPT_FALSE noexcept(false)
+# define TEST_NOEXCEPT_COND(...) noexcept(__VA_ARGS__)
+#else
+#   if defined(TEST_COMPILER_CLANG)
+#    define TEST_ALIGNOF(...) _Alignof(__VA_ARGS__)
+#   else
+#    define TEST_ALIGNOF(...) __alignof(__VA_ARGS__)
+#   endif
+# define TEST_ALIGNAS(...) __attribute__((__aligned__(__VA_ARGS__)))
+# define TEST_CONSTEXPR
+# define TEST_NOEXCEPT throw()
+# define TEST_NOEXCEPT_FALSE
+# define TEST_NOEXCEPT_COND(...)
+#endif
+
+#if TEST_STD_VER >= 17
+# define TEST_THROW_SPEC(...)
 #else
-#if defined(TEST_COMPILER_CLANG)
-# define TEST_ALIGNOF(...) _Alignof(__VA_ARGS__)
+# define TEST_THROW_SPEC(...) throw(__VA_ARGS__)
+#endif
+
+#if TEST_STD_VER >= 14
+# define TEST_CONSTEXPR_CXX14 constexpr
+#else
+# define TEST_CONSTEXPR_CXX14
+#endif
+
+#if TEST_STD_VER >= 20
+# define TEST_CONSTEXPR_CXX20 constexpr
 #else
-# define TEST_ALIGNOF(...) __alignof(__VA_ARGS__)
-#endif
-#define TEST_ALIGNAS(...) __attribute__((__aligned__(__VA_ARGS__)))
-#define TEST_CONSTEXPR
-#define TEST_CONSTEXPR_CXX14
-#define TEST_CONSTEXPR_CXX20
-#define TEST_NOEXCEPT throw()
-#define TEST_NOEXCEPT_FALSE
-#define TEST_NOEXCEPT_COND(...)
-#define TEST_THROW_SPEC(...) throw(__VA_ARGS__)
+# define TEST_CONSTEXPR_CXX20
 #endif
 
 // Sniff out to see if the underlying C library has C11 features


        


More information about the libcxx-commits mailing list