limits.version.pass.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // WARNING: This test was generated by generate_feature_test_macros_tests.py and
  11. // should not be edited manually.
  12. // <limits>
  13. // Test the feature test macros defined by <limits>
  14. /* Constant Value
  15. __cpp_lib_char8_t 201811L [C++2a]
  16. */
  17. #include <limits>
  18. #include "test_macros.h"
  19. #if TEST_STD_VER < 14
  20. # ifdef __cpp_lib_char8_t
  21. # error "__cpp_lib_char8_t should not be defined before c++2a"
  22. # endif
  23. #elif TEST_STD_VER == 14
  24. # ifdef __cpp_lib_char8_t
  25. # error "__cpp_lib_char8_t should not be defined before c++2a"
  26. # endif
  27. #elif TEST_STD_VER == 17
  28. # ifdef __cpp_lib_char8_t
  29. # error "__cpp_lib_char8_t should not be defined before c++2a"
  30. # endif
  31. #elif TEST_STD_VER > 17
  32. # if defined(__cpp_char8_t)
  33. # ifndef __cpp_lib_char8_t
  34. # error "__cpp_lib_char8_t should be defined in c++2a"
  35. # endif
  36. # if __cpp_lib_char8_t != 201811L
  37. # error "__cpp_lib_char8_t should have the value 201811L in c++2a"
  38. # endif
  39. # else
  40. # ifdef __cpp_lib_char8_t
  41. # error "__cpp_lib_char8_t should not be defined when defined(__cpp_char8_t) is not defined!"
  42. # endif
  43. # endif
  44. #endif // TEST_STD_VER > 17
  45. int main() {}