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

llvm-svn: 269773
This commit is contained in:
Marshall Clow 2016-05-17 14:58:09 +00:00
parent 4328c2bac8
commit 6c3fa193bf
1 changed files with 30 additions and 0 deletions

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