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