numeric.version.pass.cpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. // <numeric>
  13. // Test the feature test macros defined by <numeric>
  14. /* Constant Value
  15. __cpp_lib_gcd_lcm 201606L [C++17]
  16. __cpp_lib_parallel_algorithm 201603L [C++17]
  17. */
  18. #include <numeric>
  19. #include "test_macros.h"
  20. #if TEST_STD_VER < 14
  21. # ifdef __cpp_lib_gcd_lcm
  22. # error "__cpp_lib_gcd_lcm should not be defined before c++17"
  23. # endif
  24. # ifdef __cpp_lib_parallel_algorithm
  25. # error "__cpp_lib_parallel_algorithm should not be defined before c++17"
  26. # endif
  27. #elif TEST_STD_VER == 14
  28. # ifdef __cpp_lib_gcd_lcm
  29. # error "__cpp_lib_gcd_lcm should not be defined before c++17"
  30. # endif
  31. # ifdef __cpp_lib_parallel_algorithm
  32. # error "__cpp_lib_parallel_algorithm should not be defined before c++17"
  33. # endif
  34. #elif TEST_STD_VER == 17
  35. # ifndef __cpp_lib_gcd_lcm
  36. # error "__cpp_lib_gcd_lcm should be defined in c++17"
  37. # endif
  38. # if __cpp_lib_gcd_lcm != 201606L
  39. # error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
  40. # endif
  41. # if !defined(_LIBCPP_VERSION)
  42. # ifndef __cpp_lib_parallel_algorithm
  43. # error "__cpp_lib_parallel_algorithm should be defined in c++17"
  44. # endif
  45. # if __cpp_lib_parallel_algorithm != 201603L
  46. # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
  47. # endif
  48. # else // _LIBCPP_VERSION
  49. # ifdef __cpp_lib_parallel_algorithm
  50. # error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
  51. # endif
  52. # endif
  53. #elif TEST_STD_VER > 17
  54. # ifndef __cpp_lib_gcd_lcm
  55. # error "__cpp_lib_gcd_lcm should be defined in c++2a"
  56. # endif
  57. # if __cpp_lib_gcd_lcm != 201606L
  58. # error "__cpp_lib_gcd_lcm should have the value 201606L in c++2a"
  59. # endif
  60. # if !defined(_LIBCPP_VERSION)
  61. # ifndef __cpp_lib_parallel_algorithm
  62. # error "__cpp_lib_parallel_algorithm should be defined in c++2a"
  63. # endif
  64. # if __cpp_lib_parallel_algorithm != 201603L
  65. # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++2a"
  66. # endif
  67. # else // _LIBCPP_VERSION
  68. # ifdef __cpp_lib_parallel_algorithm
  69. # error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
  70. # endif
  71. # endif
  72. #endif // TEST_STD_VER > 17
  73. int main() {}