chrono.version.pass.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. // <chrono>
  13. // Test the feature test macros defined by <chrono>
  14. /* Constant Value
  15. __cpp_lib_chrono 201611L [C++17]
  16. __cpp_lib_chrono_udls 201304L [C++14]
  17. */
  18. #include <chrono>
  19. #include "test_macros.h"
  20. #if TEST_STD_VER < 14
  21. # ifdef __cpp_lib_chrono
  22. # error "__cpp_lib_chrono should not be defined before c++17"
  23. # endif
  24. # ifdef __cpp_lib_chrono_udls
  25. # error "__cpp_lib_chrono_udls should not be defined before c++14"
  26. # endif
  27. #elif TEST_STD_VER == 14
  28. # ifdef __cpp_lib_chrono
  29. # error "__cpp_lib_chrono should not be defined before c++17"
  30. # endif
  31. # ifndef __cpp_lib_chrono_udls
  32. # error "__cpp_lib_chrono_udls should be defined in c++14"
  33. # endif
  34. # if __cpp_lib_chrono_udls != 201304L
  35. # error "__cpp_lib_chrono_udls should have the value 201304L in c++14"
  36. # endif
  37. #elif TEST_STD_VER == 17
  38. # ifndef __cpp_lib_chrono
  39. # error "__cpp_lib_chrono should be defined in c++17"
  40. # endif
  41. # if __cpp_lib_chrono != 201611L
  42. # error "__cpp_lib_chrono should have the value 201611L in c++17"
  43. # endif
  44. # ifndef __cpp_lib_chrono_udls
  45. # error "__cpp_lib_chrono_udls should be defined in c++17"
  46. # endif
  47. # if __cpp_lib_chrono_udls != 201304L
  48. # error "__cpp_lib_chrono_udls should have the value 201304L in c++17"
  49. # endif
  50. #elif TEST_STD_VER > 17
  51. # ifndef __cpp_lib_chrono
  52. # error "__cpp_lib_chrono should be defined in c++2a"
  53. # endif
  54. # if __cpp_lib_chrono != 201611L
  55. # error "__cpp_lib_chrono should have the value 201611L in c++2a"
  56. # endif
  57. # ifndef __cpp_lib_chrono_udls
  58. # error "__cpp_lib_chrono_udls should be defined in c++2a"
  59. # endif
  60. # if __cpp_lib_chrono_udls != 201304L
  61. # error "__cpp_lib_chrono_udls should have the value 201304L in c++2a"
  62. # endif
  63. #endif // TEST_STD_VER > 17
  64. int main() {}