numeric.version.pass.cpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // WARNING: This test was generated by generate_feature_test_macro_components.py
  10. // and should not be edited manually.
  11. // <numeric>
  12. // Test the feature test macros defined by <numeric>
  13. /* Constant Value
  14. __cpp_lib_gcd_lcm 201606L [C++17]
  15. __cpp_lib_interpolate 201902L [C++2a]
  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_interpolate
  25. # error "__cpp_lib_interpolate should not be defined before c++2a"
  26. # endif
  27. # ifdef __cpp_lib_parallel_algorithm
  28. # error "__cpp_lib_parallel_algorithm should not be defined before c++17"
  29. # endif
  30. #elif TEST_STD_VER == 14
  31. # ifdef __cpp_lib_gcd_lcm
  32. # error "__cpp_lib_gcd_lcm should not be defined before c++17"
  33. # endif
  34. # ifdef __cpp_lib_interpolate
  35. # error "__cpp_lib_interpolate should not be defined before c++2a"
  36. # endif
  37. # ifdef __cpp_lib_parallel_algorithm
  38. # error "__cpp_lib_parallel_algorithm should not be defined before c++17"
  39. # endif
  40. #elif TEST_STD_VER == 17
  41. # ifndef __cpp_lib_gcd_lcm
  42. # error "__cpp_lib_gcd_lcm should be defined in c++17"
  43. # endif
  44. # if __cpp_lib_gcd_lcm != 201606L
  45. # error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
  46. # endif
  47. # ifdef __cpp_lib_interpolate
  48. # error "__cpp_lib_interpolate should not be defined before c++2a"
  49. # endif
  50. # if !defined(_LIBCPP_VERSION)
  51. # ifndef __cpp_lib_parallel_algorithm
  52. # error "__cpp_lib_parallel_algorithm should be defined in c++17"
  53. # endif
  54. # if __cpp_lib_parallel_algorithm != 201603L
  55. # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
  56. # endif
  57. # else // _LIBCPP_VERSION
  58. # ifdef __cpp_lib_parallel_algorithm
  59. # error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
  60. # endif
  61. # endif
  62. #elif TEST_STD_VER > 17
  63. # ifndef __cpp_lib_gcd_lcm
  64. # error "__cpp_lib_gcd_lcm should be defined in c++2a"
  65. # endif
  66. # if __cpp_lib_gcd_lcm != 201606L
  67. # error "__cpp_lib_gcd_lcm should have the value 201606L in c++2a"
  68. # endif
  69. # ifndef __cpp_lib_interpolate
  70. # error "__cpp_lib_interpolate should be defined in c++2a"
  71. # endif
  72. # if __cpp_lib_interpolate != 201902L
  73. # error "__cpp_lib_interpolate should have the value 201902L in c++2a"
  74. # endif
  75. # if !defined(_LIBCPP_VERSION)
  76. # ifndef __cpp_lib_parallel_algorithm
  77. # error "__cpp_lib_parallel_algorithm should be defined in c++2a"
  78. # endif
  79. # if __cpp_lib_parallel_algorithm != 201603L
  80. # error "__cpp_lib_parallel_algorithm should have the value 201603L in c++2a"
  81. # endif
  82. # else // _LIBCPP_VERSION
  83. # ifdef __cpp_lib_parallel_algorithm
  84. # error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
  85. # endif
  86. # endif
  87. #endif // TEST_STD_VER > 17
  88. int main(int, char**) { return 0; }