| 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 | |
| 12 | // <chrono> |
| 13 | |
| 14 | // Test the feature test macros defined by <chrono> |
| 15 | |
| 16 | // clang-format off |
| 17 | |
| 18 | #include <chrono> |
| 19 | #include "test_macros.h" |
| 20 | |
| 21 | #if TEST_STD_VER < 14 |
| 22 | |
| 23 | # ifdef __cpp_lib_chrono |
| 24 | # error "__cpp_lib_chrono should not be defined before c++17" |
| 25 | # endif |
| 26 | |
| 27 | # ifdef __cpp_lib_chrono_udls |
| 28 | # error "__cpp_lib_chrono_udls should not be defined before c++14" |
| 29 | # endif |
| 30 | |
| 31 | #elif TEST_STD_VER == 14 |
| 32 | |
| 33 | # ifdef __cpp_lib_chrono |
| 34 | # error "__cpp_lib_chrono should not be defined before c++17" |
| 35 | # endif |
| 36 | |
| 37 | # ifndef __cpp_lib_chrono_udls |
| 38 | # error "__cpp_lib_chrono_udls should be defined in c++14" |
| 39 | # endif |
| 40 | # if __cpp_lib_chrono_udls != 201304L |
| 41 | # error "__cpp_lib_chrono_udls should have the value 201304L in c++14" |
| 42 | # endif |
| 43 | |
| 44 | #elif TEST_STD_VER == 17 |
| 45 | |
| 46 | # ifndef __cpp_lib_chrono |
| 47 | # error "__cpp_lib_chrono should be defined in c++17" |
| 48 | # endif |
| 49 | # if __cpp_lib_chrono != 201611L |
| 50 | # error "__cpp_lib_chrono should have the value 201611L in c++17" |
| 51 | # endif |
| 52 | |
| 53 | # ifndef __cpp_lib_chrono_udls |
| 54 | # error "__cpp_lib_chrono_udls should be defined in c++17" |
| 55 | # endif |
| 56 | # if __cpp_lib_chrono_udls != 201304L |
| 57 | # error "__cpp_lib_chrono_udls should have the value 201304L in c++17" |
| 58 | # endif |
| 59 | |
| 60 | #elif TEST_STD_VER == 20 |
| 61 | |
| 62 | # ifndef __cpp_lib_chrono |
| 63 | # error "__cpp_lib_chrono should be defined in c++20" |
| 64 | # endif |
| 65 | # if __cpp_lib_chrono != 201611L |
| 66 | # error "__cpp_lib_chrono should have the value 201611L in c++20" |
| 67 | # endif |
| 68 | |
| 69 | # ifndef __cpp_lib_chrono_udls |
| 70 | # error "__cpp_lib_chrono_udls should be defined in c++20" |
| 71 | # endif |
| 72 | # if __cpp_lib_chrono_udls != 201304L |
| 73 | # error "__cpp_lib_chrono_udls should have the value 201304L in c++20" |
| 74 | # endif |
| 75 | |
| 76 | #elif TEST_STD_VER == 23 |
| 77 | |
| 78 | # ifndef __cpp_lib_chrono |
| 79 | # error "__cpp_lib_chrono should be defined in c++23" |
| 80 | # endif |
| 81 | # if __cpp_lib_chrono != 201611L |
| 82 | # error "__cpp_lib_chrono should have the value 201611L in c++23" |
| 83 | # endif |
| 84 | |
| 85 | # ifndef __cpp_lib_chrono_udls |
| 86 | # error "__cpp_lib_chrono_udls should be defined in c++23" |
| 87 | # endif |
| 88 | # if __cpp_lib_chrono_udls != 201304L |
| 89 | # error "__cpp_lib_chrono_udls should have the value 201304L in c++23" |
| 90 | # endif |
| 91 | |
| 92 | #elif TEST_STD_VER > 23 |
| 93 | |
| 94 | # ifndef __cpp_lib_chrono |
| 95 | # error "__cpp_lib_chrono should be defined in c++26" |
| 96 | # endif |
| 97 | # if __cpp_lib_chrono != 201611L |
| 98 | # error "__cpp_lib_chrono should have the value 201611L in c++26" |
| 99 | # endif |
| 100 | |
| 101 | # ifndef __cpp_lib_chrono_udls |
| 102 | # error "__cpp_lib_chrono_udls should be defined in c++26" |
| 103 | # endif |
| 104 | # if __cpp_lib_chrono_udls != 201304L |
| 105 | # error "__cpp_lib_chrono_udls should have the value 201304L in c++26" |
| 106 | # endif |
| 107 | |
| 108 | #endif // TEST_STD_VER > 23 |
| 109 | |
| 110 | // clang-format on |
| 111 | |
| 112 | |