[libcxx] r269773 - Add some checking so that the TEST_HAS_XXX macros match up with the _LIBCPP_NO_HAS_XXX macros. No functional change
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Tue May 17 07:58:10 PDT 2016
Author: marshall
Date: Tue May 17 09:58:09 2016
New Revision: 269773
URL: http://llvm.org/viewvc/llvm-project?rev=269773&view=rev
Log:
Add some checking so that the TEST_HAS_XXX macros match up with the _LIBCPP_NO_HAS_XXX macros. No functional change
Modified:
libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp
Modified: libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp?rev=269773&r1=269772&r2=269773&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp Tue May 17 09:58:09 2016
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// Test the "test_macros.h" header.
+#include <__config>
#include "test_macros.h"
#ifndef TEST_STD_VER
@@ -30,7 +31,36 @@ void test_noexcept() TEST_NOEXCEPT
{
}
+void test_libcxx_macros()
+{
+// ===== C++14 features =====
+// defined(TEST_HAS_EXTENDED_CONSTEXPR) != defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
+#ifdef TEST_HAS_EXTENDED_CONSTEXPR
+# ifdef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+# error "TEST_EXTENDED_CONSTEXPR mismatch (1)"
+# endif
+#else
+# ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+# error "TEST_EXTENDED_CONSTEXPR mismatch (2)"
+# endif
+#endif
+
+// defined(TEST_HAS_VARIABLE_TEMPLATES) != defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+#ifdef TEST_HAS_VARIABLE_TEMPLATES
+# ifdef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
+# error "TEST_VARIABLE_TEMPLATES mismatch (1)"
+# endif
+#else
+# ifndef _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
+# error "TEST_VARIABLE_TEMPLATES mismatch (2)"
+# endif
+#endif
+
+// ===== C++1z features =====
+}
+
int main()
{
test_noexcept();
+ test_libcxx_macros();
}
More information about the cfe-commits
mailing list