Add some checking so that the TEST_HAS_XXX macros match up with the _LIBCPP_NO_HAS_XXX macros. No functional change

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@269773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2016-05-17 14:58:09 +00:00
parent 2c15439dd3
commit 7f271a0b77

View File

@@ -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();
}