12c6217f2SLouis Dionne //===----------------------------------------------------------------------===//
22c6217f2SLouis Dionne //
32c6217f2SLouis Dionne // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42c6217f2SLouis Dionne // See https://llvm.org/LICENSE.txt for license information.
52c6217f2SLouis Dionne // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
62c6217f2SLouis Dionne //
72c6217f2SLouis Dionne //===----------------------------------------------------------------------===//
82c6217f2SLouis Dionne //
92c6217f2SLouis Dionne // WARNING: This test was generated by generate_feature_test_macro_components.py
102c6217f2SLouis Dionne // and should not be edited manually.
112c6217f2SLouis Dionne //
122c6217f2SLouis Dionne // clang-format off
132c6217f2SLouis Dionne 
142c6217f2SLouis Dionne // <bit>
152c6217f2SLouis Dionne 
162c6217f2SLouis Dionne // Test the feature test macros defined by <bit>
172c6217f2SLouis Dionne 
182c6217f2SLouis Dionne /*  Constant              Value
192c6217f2SLouis Dionne     __cpp_lib_bit_cast    201806L [C++20]
202c6217f2SLouis Dionne     __cpp_lib_bitops      201907L [C++20]
2171400505SMark de Wever     __cpp_lib_byteswap    202110L [C++23]
222c6217f2SLouis Dionne     __cpp_lib_endian      201907L [C++20]
232c6217f2SLouis Dionne     __cpp_lib_int_pow2    202002L [C++20]
242c6217f2SLouis Dionne */
252c6217f2SLouis Dionne 
262c6217f2SLouis Dionne #include <bit>
272c6217f2SLouis Dionne #include "test_macros.h"
282c6217f2SLouis Dionne 
292c6217f2SLouis Dionne #if TEST_STD_VER < 14
302c6217f2SLouis Dionne 
312c6217f2SLouis Dionne # ifdef __cpp_lib_bit_cast
322c6217f2SLouis Dionne #   error "__cpp_lib_bit_cast should not be defined before c++20"
332c6217f2SLouis Dionne # endif
342c6217f2SLouis Dionne 
352c6217f2SLouis Dionne # ifdef __cpp_lib_bitops
362c6217f2SLouis Dionne #   error "__cpp_lib_bitops should not be defined before c++20"
372c6217f2SLouis Dionne # endif
382c6217f2SLouis Dionne 
392c6217f2SLouis Dionne # ifdef __cpp_lib_byteswap
4071400505SMark de Wever #   error "__cpp_lib_byteswap should not be defined before c++23"
412c6217f2SLouis Dionne # endif
422c6217f2SLouis Dionne 
432c6217f2SLouis Dionne # ifdef __cpp_lib_endian
442c6217f2SLouis Dionne #   error "__cpp_lib_endian should not be defined before c++20"
452c6217f2SLouis Dionne # endif
462c6217f2SLouis Dionne 
472c6217f2SLouis Dionne # ifdef __cpp_lib_int_pow2
482c6217f2SLouis Dionne #   error "__cpp_lib_int_pow2 should not be defined before c++20"
492c6217f2SLouis Dionne # endif
502c6217f2SLouis Dionne 
512c6217f2SLouis Dionne #elif TEST_STD_VER == 14
522c6217f2SLouis Dionne 
532c6217f2SLouis Dionne # ifdef __cpp_lib_bit_cast
542c6217f2SLouis Dionne #   error "__cpp_lib_bit_cast should not be defined before c++20"
552c6217f2SLouis Dionne # endif
562c6217f2SLouis Dionne 
572c6217f2SLouis Dionne # ifdef __cpp_lib_bitops
582c6217f2SLouis Dionne #   error "__cpp_lib_bitops should not be defined before c++20"
592c6217f2SLouis Dionne # endif
602c6217f2SLouis Dionne 
612c6217f2SLouis Dionne # ifdef __cpp_lib_byteswap
6271400505SMark de Wever #   error "__cpp_lib_byteswap should not be defined before c++23"
632c6217f2SLouis Dionne # endif
642c6217f2SLouis Dionne 
652c6217f2SLouis Dionne # ifdef __cpp_lib_endian
662c6217f2SLouis Dionne #   error "__cpp_lib_endian should not be defined before c++20"
672c6217f2SLouis Dionne # endif
682c6217f2SLouis Dionne 
692c6217f2SLouis Dionne # ifdef __cpp_lib_int_pow2
702c6217f2SLouis Dionne #   error "__cpp_lib_int_pow2 should not be defined before c++20"
712c6217f2SLouis Dionne # endif
722c6217f2SLouis Dionne 
732c6217f2SLouis Dionne #elif TEST_STD_VER == 17
742c6217f2SLouis Dionne 
752c6217f2SLouis Dionne # ifdef __cpp_lib_bit_cast
762c6217f2SLouis Dionne #   error "__cpp_lib_bit_cast should not be defined before c++20"
772c6217f2SLouis Dionne # endif
782c6217f2SLouis Dionne 
792c6217f2SLouis Dionne # ifdef __cpp_lib_bitops
802c6217f2SLouis Dionne #   error "__cpp_lib_bitops should not be defined before c++20"
812c6217f2SLouis Dionne # endif
822c6217f2SLouis Dionne 
832c6217f2SLouis Dionne # ifdef __cpp_lib_byteswap
8471400505SMark de Wever #   error "__cpp_lib_byteswap should not be defined before c++23"
852c6217f2SLouis Dionne # endif
862c6217f2SLouis Dionne 
872c6217f2SLouis Dionne # ifdef __cpp_lib_endian
882c6217f2SLouis Dionne #   error "__cpp_lib_endian should not be defined before c++20"
892c6217f2SLouis Dionne # endif
902c6217f2SLouis Dionne 
912c6217f2SLouis Dionne # ifdef __cpp_lib_int_pow2
922c6217f2SLouis Dionne #   error "__cpp_lib_int_pow2 should not be defined before c++20"
932c6217f2SLouis Dionne # endif
942c6217f2SLouis Dionne 
952c6217f2SLouis Dionne #elif TEST_STD_VER == 20
962c6217f2SLouis Dionne 
972c6217f2SLouis Dionne # ifndef __cpp_lib_bit_cast
982c6217f2SLouis Dionne #   error "__cpp_lib_bit_cast should be defined in c++20"
992c6217f2SLouis Dionne # endif
1002c6217f2SLouis Dionne # if __cpp_lib_bit_cast != 201806L
1012c6217f2SLouis Dionne #   error "__cpp_lib_bit_cast should have the value 201806L in c++20"
1022c6217f2SLouis Dionne # endif
1032c6217f2SLouis Dionne 
1042c6217f2SLouis Dionne # ifndef __cpp_lib_bitops
1052c6217f2SLouis Dionne #   error "__cpp_lib_bitops should be defined in c++20"
1062c6217f2SLouis Dionne # endif
1072c6217f2SLouis Dionne # if __cpp_lib_bitops != 201907L
1082c6217f2SLouis Dionne #   error "__cpp_lib_bitops should have the value 201907L in c++20"
1092c6217f2SLouis Dionne # endif
1102c6217f2SLouis Dionne 
1112c6217f2SLouis Dionne # ifdef __cpp_lib_byteswap
11271400505SMark de Wever #   error "__cpp_lib_byteswap should not be defined before c++23"
1132c6217f2SLouis Dionne # endif
1142c6217f2SLouis Dionne 
1152c6217f2SLouis Dionne # ifndef __cpp_lib_endian
1162c6217f2SLouis Dionne #   error "__cpp_lib_endian should be defined in c++20"
1172c6217f2SLouis Dionne # endif
1182c6217f2SLouis Dionne # if __cpp_lib_endian != 201907L
1192c6217f2SLouis Dionne #   error "__cpp_lib_endian should have the value 201907L in c++20"
1202c6217f2SLouis Dionne # endif
1212c6217f2SLouis Dionne 
1222c6217f2SLouis Dionne # ifndef __cpp_lib_int_pow2
1232c6217f2SLouis Dionne #   error "__cpp_lib_int_pow2 should be defined in c++20"
1242c6217f2SLouis Dionne # endif
1252c6217f2SLouis Dionne # if __cpp_lib_int_pow2 != 202002L
1262c6217f2SLouis Dionne #   error "__cpp_lib_int_pow2 should have the value 202002L in c++20"
1272c6217f2SLouis Dionne # endif
1282c6217f2SLouis Dionne 
129*00c97cbcSMark de Wever #elif TEST_STD_VER == 23
1302c6217f2SLouis Dionne 
1312c6217f2SLouis Dionne # ifndef __cpp_lib_bit_cast
13271400505SMark de Wever #   error "__cpp_lib_bit_cast should be defined in c++23"
1332c6217f2SLouis Dionne # endif
1342c6217f2SLouis Dionne # if __cpp_lib_bit_cast != 201806L
13571400505SMark de Wever #   error "__cpp_lib_bit_cast should have the value 201806L in c++23"
1362c6217f2SLouis Dionne # endif
1372c6217f2SLouis Dionne 
1382c6217f2SLouis Dionne # ifndef __cpp_lib_bitops
13971400505SMark de Wever #   error "__cpp_lib_bitops should be defined in c++23"
1402c6217f2SLouis Dionne # endif
1412c6217f2SLouis Dionne # if __cpp_lib_bitops != 201907L
14271400505SMark de Wever #   error "__cpp_lib_bitops should have the value 201907L in c++23"
1432c6217f2SLouis Dionne # endif
1442c6217f2SLouis Dionne 
1452c6217f2SLouis Dionne # ifndef __cpp_lib_byteswap
14671400505SMark de Wever #   error "__cpp_lib_byteswap should be defined in c++23"
1472c6217f2SLouis Dionne # endif
1482c6217f2SLouis Dionne # if __cpp_lib_byteswap != 202110L
14971400505SMark de Wever #   error "__cpp_lib_byteswap should have the value 202110L in c++23"
1502c6217f2SLouis Dionne # endif
1512c6217f2SLouis Dionne 
1522c6217f2SLouis Dionne # ifndef __cpp_lib_endian
15371400505SMark de Wever #   error "__cpp_lib_endian should be defined in c++23"
1542c6217f2SLouis Dionne # endif
1552c6217f2SLouis Dionne # if __cpp_lib_endian != 201907L
15671400505SMark de Wever #   error "__cpp_lib_endian should have the value 201907L in c++23"
1572c6217f2SLouis Dionne # endif
1582c6217f2SLouis Dionne 
1592c6217f2SLouis Dionne # ifndef __cpp_lib_int_pow2
16071400505SMark de Wever #   error "__cpp_lib_int_pow2 should be defined in c++23"
1612c6217f2SLouis Dionne # endif
1622c6217f2SLouis Dionne # if __cpp_lib_int_pow2 != 202002L
16371400505SMark de Wever #   error "__cpp_lib_int_pow2 should have the value 202002L in c++23"
1642c6217f2SLouis Dionne # endif
1652c6217f2SLouis Dionne 
166*00c97cbcSMark de Wever #elif TEST_STD_VER > 23
167*00c97cbcSMark de Wever 
168*00c97cbcSMark de Wever # ifndef __cpp_lib_bit_cast
169*00c97cbcSMark de Wever #   error "__cpp_lib_bit_cast should be defined in c++26"
170*00c97cbcSMark de Wever # endif
171*00c97cbcSMark de Wever # if __cpp_lib_bit_cast != 201806L
172*00c97cbcSMark de Wever #   error "__cpp_lib_bit_cast should have the value 201806L in c++26"
173*00c97cbcSMark de Wever # endif
174*00c97cbcSMark de Wever 
175*00c97cbcSMark de Wever # ifndef __cpp_lib_bitops
176*00c97cbcSMark de Wever #   error "__cpp_lib_bitops should be defined in c++26"
177*00c97cbcSMark de Wever # endif
178*00c97cbcSMark de Wever # if __cpp_lib_bitops != 201907L
179*00c97cbcSMark de Wever #   error "__cpp_lib_bitops should have the value 201907L in c++26"
180*00c97cbcSMark de Wever # endif
181*00c97cbcSMark de Wever 
182*00c97cbcSMark de Wever # ifndef __cpp_lib_byteswap
183*00c97cbcSMark de Wever #   error "__cpp_lib_byteswap should be defined in c++26"
184*00c97cbcSMark de Wever # endif
185*00c97cbcSMark de Wever # if __cpp_lib_byteswap != 202110L
186*00c97cbcSMark de Wever #   error "__cpp_lib_byteswap should have the value 202110L in c++26"
187*00c97cbcSMark de Wever # endif
188*00c97cbcSMark de Wever 
189*00c97cbcSMark de Wever # ifndef __cpp_lib_endian
190*00c97cbcSMark de Wever #   error "__cpp_lib_endian should be defined in c++26"
191*00c97cbcSMark de Wever # endif
192*00c97cbcSMark de Wever # if __cpp_lib_endian != 201907L
193*00c97cbcSMark de Wever #   error "__cpp_lib_endian should have the value 201907L in c++26"
194*00c97cbcSMark de Wever # endif
195*00c97cbcSMark de Wever 
196*00c97cbcSMark de Wever # ifndef __cpp_lib_int_pow2
197*00c97cbcSMark de Wever #   error "__cpp_lib_int_pow2 should be defined in c++26"
198*00c97cbcSMark de Wever # endif
199*00c97cbcSMark de Wever # if __cpp_lib_int_pow2 != 202002L
200*00c97cbcSMark de Wever #   error "__cpp_lib_int_pow2 should have the value 202002L in c++26"
201*00c97cbcSMark de Wever # endif
202*00c97cbcSMark de Wever 
203*00c97cbcSMark de Wever #endif // TEST_STD_VER > 23
2042c6217f2SLouis Dionne 
205