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