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 // <numeric>
15 
16 // Test the feature test macros defined by <numeric>
17 
18 /*  Constant                        Value
19     __cpp_lib_constexpr_numeric     201911L [C++20]
20     __cpp_lib_gcd_lcm               201606L [C++17]
21     __cpp_lib_interpolate           201902L [C++20]
22     __cpp_lib_parallel_algorithm    201603L [C++17]
23     __cpp_lib_ranges_iota           202202L [C++23]
24 */
25 
26 #include <numeric>
27 #include "test_macros.h"
28 
29 #if TEST_STD_VER < 14
30 
31 # ifdef __cpp_lib_constexpr_numeric
32 #   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
33 # endif
34 
35 # ifdef __cpp_lib_gcd_lcm
36 #   error "__cpp_lib_gcd_lcm should not be defined before c++17"
37 # endif
38 
39 # ifdef __cpp_lib_interpolate
40 #   error "__cpp_lib_interpolate should not be defined before c++20"
41 # endif
42 
43 # ifdef __cpp_lib_parallel_algorithm
44 #   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
45 # endif
46 
47 # ifdef __cpp_lib_ranges_iota
48 #   error "__cpp_lib_ranges_iota should not be defined before c++23"
49 # endif
50 
51 #elif TEST_STD_VER == 14
52 
53 # ifdef __cpp_lib_constexpr_numeric
54 #   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
55 # endif
56 
57 # ifdef __cpp_lib_gcd_lcm
58 #   error "__cpp_lib_gcd_lcm should not be defined before c++17"
59 # endif
60 
61 # ifdef __cpp_lib_interpolate
62 #   error "__cpp_lib_interpolate should not be defined before c++20"
63 # endif
64 
65 # ifdef __cpp_lib_parallel_algorithm
66 #   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
67 # endif
68 
69 # ifdef __cpp_lib_ranges_iota
70 #   error "__cpp_lib_ranges_iota should not be defined before c++23"
71 # endif
72 
73 #elif TEST_STD_VER == 17
74 
75 # ifdef __cpp_lib_constexpr_numeric
76 #   error "__cpp_lib_constexpr_numeric should not be defined before c++20"
77 # endif
78 
79 # ifndef __cpp_lib_gcd_lcm
80 #   error "__cpp_lib_gcd_lcm should be defined in c++17"
81 # endif
82 # if __cpp_lib_gcd_lcm != 201606L
83 #   error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
84 # endif
85 
86 # ifdef __cpp_lib_interpolate
87 #   error "__cpp_lib_interpolate should not be defined before c++20"
88 # endif
89 
90 # if !defined(_LIBCPP_VERSION)
91 #   ifndef __cpp_lib_parallel_algorithm
92 #     error "__cpp_lib_parallel_algorithm should be defined in c++17"
93 #   endif
94 #   if __cpp_lib_parallel_algorithm != 201603L
95 #     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
96 #   endif
97 # else // _LIBCPP_VERSION
98 #   ifdef __cpp_lib_parallel_algorithm
99 #     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
100 #   endif
101 # endif
102 
103 # ifdef __cpp_lib_ranges_iota
104 #   error "__cpp_lib_ranges_iota should not be defined before c++23"
105 # endif
106 
107 #elif TEST_STD_VER == 20
108 
109 # ifndef __cpp_lib_constexpr_numeric
110 #   error "__cpp_lib_constexpr_numeric should be defined in c++20"
111 # endif
112 # if __cpp_lib_constexpr_numeric != 201911L
113 #   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++20"
114 # endif
115 
116 # ifndef __cpp_lib_gcd_lcm
117 #   error "__cpp_lib_gcd_lcm should be defined in c++20"
118 # endif
119 # if __cpp_lib_gcd_lcm != 201606L
120 #   error "__cpp_lib_gcd_lcm should have the value 201606L in c++20"
121 # endif
122 
123 # ifndef __cpp_lib_interpolate
124 #   error "__cpp_lib_interpolate should be defined in c++20"
125 # endif
126 # if __cpp_lib_interpolate != 201902L
127 #   error "__cpp_lib_interpolate should have the value 201902L in c++20"
128 # endif
129 
130 # if !defined(_LIBCPP_VERSION)
131 #   ifndef __cpp_lib_parallel_algorithm
132 #     error "__cpp_lib_parallel_algorithm should be defined in c++20"
133 #   endif
134 #   if __cpp_lib_parallel_algorithm != 201603L
135 #     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20"
136 #   endif
137 # else // _LIBCPP_VERSION
138 #   ifdef __cpp_lib_parallel_algorithm
139 #     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
140 #   endif
141 # endif
142 
143 # ifdef __cpp_lib_ranges_iota
144 #   error "__cpp_lib_ranges_iota should not be defined before c++23"
145 # endif
146 
147 #elif TEST_STD_VER > 20
148 
149 # ifndef __cpp_lib_constexpr_numeric
150 #   error "__cpp_lib_constexpr_numeric should be defined in c++23"
151 # endif
152 # if __cpp_lib_constexpr_numeric != 201911L
153 #   error "__cpp_lib_constexpr_numeric should have the value 201911L in c++23"
154 # endif
155 
156 # ifndef __cpp_lib_gcd_lcm
157 #   error "__cpp_lib_gcd_lcm should be defined in c++23"
158 # endif
159 # if __cpp_lib_gcd_lcm != 201606L
160 #   error "__cpp_lib_gcd_lcm should have the value 201606L in c++23"
161 # endif
162 
163 # ifndef __cpp_lib_interpolate
164 #   error "__cpp_lib_interpolate should be defined in c++23"
165 # endif
166 # if __cpp_lib_interpolate != 201902L
167 #   error "__cpp_lib_interpolate should have the value 201902L in c++23"
168 # endif
169 
170 # if !defined(_LIBCPP_VERSION)
171 #   ifndef __cpp_lib_parallel_algorithm
172 #     error "__cpp_lib_parallel_algorithm should be defined in c++23"
173 #   endif
174 #   if __cpp_lib_parallel_algorithm != 201603L
175 #     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23"
176 #   endif
177 # else // _LIBCPP_VERSION
178 #   ifdef __cpp_lib_parallel_algorithm
179 #     error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!"
180 #   endif
181 # endif
182 
183 # if !defined(_LIBCPP_VERSION)
184 #   ifndef __cpp_lib_ranges_iota
185 #     error "__cpp_lib_ranges_iota should be defined in c++23"
186 #   endif
187 #   if __cpp_lib_ranges_iota != 202202L
188 #     error "__cpp_lib_ranges_iota should have the value 202202L in c++23"
189 #   endif
190 # else // _LIBCPP_VERSION
191 #   ifdef __cpp_lib_ranges_iota
192 #     error "__cpp_lib_ranges_iota should not be defined because it is unimplemented in libc++!"
193 #   endif
194 # endif
195 
196 #endif // TEST_STD_VER > 20
197 
198