filesystem.version.pass.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. // <filesystem>
  12. // Test the feature test macros defined by <filesystem>
  13. /* Constant Value
  14. __cpp_lib_char8_t 201811L [C++2a]
  15. __cpp_lib_filesystem 201703L [C++17]
  16. */
  17. #include <filesystem>
  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. # ifdef __cpp_lib_filesystem
  24. # error "__cpp_lib_filesystem should not be defined before c++17"
  25. # endif
  26. #elif TEST_STD_VER == 14
  27. # ifdef __cpp_lib_char8_t
  28. # error "__cpp_lib_char8_t should not be defined before c++2a"
  29. # endif
  30. # ifdef __cpp_lib_filesystem
  31. # error "__cpp_lib_filesystem should not be defined before c++17"
  32. # endif
  33. #elif TEST_STD_VER == 17
  34. # ifdef __cpp_lib_char8_t
  35. # error "__cpp_lib_char8_t should not be defined before c++2a"
  36. # endif
  37. # ifndef __cpp_lib_filesystem
  38. # error "__cpp_lib_filesystem should be defined in c++17"
  39. # endif
  40. # if __cpp_lib_filesystem != 201703L
  41. # error "__cpp_lib_filesystem should have the value 201703L in c++17"
  42. # endif
  43. #elif TEST_STD_VER > 17
  44. # if defined(__cpp_char8_t)
  45. # ifndef __cpp_lib_char8_t
  46. # error "__cpp_lib_char8_t should be defined in c++2a"
  47. # endif
  48. # if __cpp_lib_char8_t != 201811L
  49. # error "__cpp_lib_char8_t should have the value 201811L in c++2a"
  50. # endif
  51. # else
  52. # ifdef __cpp_lib_char8_t
  53. # error "__cpp_lib_char8_t should not be defined when defined(__cpp_char8_t) is not defined!"
  54. # endif
  55. # endif
  56. # ifndef __cpp_lib_filesystem
  57. # error "__cpp_lib_filesystem should be defined in c++2a"
  58. # endif
  59. # if __cpp_lib_filesystem != 201703L
  60. # error "__cpp_lib_filesystem should have the value 201703L in c++2a"
  61. # endif
  62. #endif // TEST_STD_VER > 17
  63. int main(int, char**) { return 0; }