198 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// WARNING: This test was generated by generate_feature_test_macro_components.py10// and should not be edited manually.11 12// <bit>13 14// Test the feature test macros defined by <bit>15 16// clang-format off17 18#include <bit>19#include "test_macros.h"20 21#if TEST_STD_VER < 1422 23# ifdef __cpp_lib_bit_cast24# error "__cpp_lib_bit_cast should not be defined before c++20"25# endif26 27# ifdef __cpp_lib_bitops28# error "__cpp_lib_bitops should not be defined before c++20"29# endif30 31# ifdef __cpp_lib_byteswap32# error "__cpp_lib_byteswap should not be defined before c++23"33# endif34 35# ifdef __cpp_lib_endian36# error "__cpp_lib_endian should not be defined before c++20"37# endif38 39# ifdef __cpp_lib_int_pow240# error "__cpp_lib_int_pow2 should not be defined before c++20"41# endif42 43#elif TEST_STD_VER == 1444 45# ifdef __cpp_lib_bit_cast46# error "__cpp_lib_bit_cast should not be defined before c++20"47# endif48 49# ifdef __cpp_lib_bitops50# error "__cpp_lib_bitops should not be defined before c++20"51# endif52 53# ifdef __cpp_lib_byteswap54# error "__cpp_lib_byteswap should not be defined before c++23"55# endif56 57# ifdef __cpp_lib_endian58# error "__cpp_lib_endian should not be defined before c++20"59# endif60 61# ifdef __cpp_lib_int_pow262# error "__cpp_lib_int_pow2 should not be defined before c++20"63# endif64 65#elif TEST_STD_VER == 1766 67# ifdef __cpp_lib_bit_cast68# error "__cpp_lib_bit_cast should not be defined before c++20"69# endif70 71# ifdef __cpp_lib_bitops72# error "__cpp_lib_bitops should not be defined before c++20"73# endif74 75# ifdef __cpp_lib_byteswap76# error "__cpp_lib_byteswap should not be defined before c++23"77# endif78 79# ifdef __cpp_lib_endian80# error "__cpp_lib_endian should not be defined before c++20"81# endif82 83# ifdef __cpp_lib_int_pow284# error "__cpp_lib_int_pow2 should not be defined before c++20"85# endif86 87#elif TEST_STD_VER == 2088 89# ifndef __cpp_lib_bit_cast90# error "__cpp_lib_bit_cast should be defined in c++20"91# endif92# if __cpp_lib_bit_cast != 201806L93# error "__cpp_lib_bit_cast should have the value 201806L in c++20"94# endif95 96# ifndef __cpp_lib_bitops97# error "__cpp_lib_bitops should be defined in c++20"98# endif99# if __cpp_lib_bitops != 201907L100# error "__cpp_lib_bitops should have the value 201907L in c++20"101# endif102 103# ifdef __cpp_lib_byteswap104# error "__cpp_lib_byteswap should not be defined before c++23"105# endif106 107# ifndef __cpp_lib_endian108# error "__cpp_lib_endian should be defined in c++20"109# endif110# if __cpp_lib_endian != 201907L111# error "__cpp_lib_endian should have the value 201907L in c++20"112# endif113 114# ifndef __cpp_lib_int_pow2115# error "__cpp_lib_int_pow2 should be defined in c++20"116# endif117# if __cpp_lib_int_pow2 != 202002L118# error "__cpp_lib_int_pow2 should have the value 202002L in c++20"119# endif120 121#elif TEST_STD_VER == 23122 123# ifndef __cpp_lib_bit_cast124# error "__cpp_lib_bit_cast should be defined in c++23"125# endif126# if __cpp_lib_bit_cast != 201806L127# error "__cpp_lib_bit_cast should have the value 201806L in c++23"128# endif129 130# ifndef __cpp_lib_bitops131# error "__cpp_lib_bitops should be defined in c++23"132# endif133# if __cpp_lib_bitops != 201907L134# error "__cpp_lib_bitops should have the value 201907L in c++23"135# endif136 137# ifndef __cpp_lib_byteswap138# error "__cpp_lib_byteswap should be defined in c++23"139# endif140# if __cpp_lib_byteswap != 202110L141# error "__cpp_lib_byteswap should have the value 202110L in c++23"142# endif143 144# ifndef __cpp_lib_endian145# error "__cpp_lib_endian should be defined in c++23"146# endif147# if __cpp_lib_endian != 201907L148# error "__cpp_lib_endian should have the value 201907L in c++23"149# endif150 151# ifndef __cpp_lib_int_pow2152# error "__cpp_lib_int_pow2 should be defined in c++23"153# endif154# if __cpp_lib_int_pow2 != 202002L155# error "__cpp_lib_int_pow2 should have the value 202002L in c++23"156# endif157 158#elif TEST_STD_VER > 23159 160# ifndef __cpp_lib_bit_cast161# error "__cpp_lib_bit_cast should be defined in c++26"162# endif163# if __cpp_lib_bit_cast != 201806L164# error "__cpp_lib_bit_cast should have the value 201806L in c++26"165# endif166 167# ifndef __cpp_lib_bitops168# error "__cpp_lib_bitops should be defined in c++26"169# endif170# if __cpp_lib_bitops != 201907L171# error "__cpp_lib_bitops should have the value 201907L in c++26"172# endif173 174# ifndef __cpp_lib_byteswap175# error "__cpp_lib_byteswap should be defined in c++26"176# endif177# if __cpp_lib_byteswap != 202110L178# error "__cpp_lib_byteswap should have the value 202110L in c++26"179# endif180 181# ifndef __cpp_lib_endian182# error "__cpp_lib_endian should be defined in c++26"183# endif184# if __cpp_lib_endian != 201907L185# error "__cpp_lib_endian should have the value 201907L in c++26"186# endif187 188# ifndef __cpp_lib_int_pow2189# error "__cpp_lib_int_pow2 should be defined in c++26"190# endif191# if __cpp_lib_int_pow2 != 202002L192# error "__cpp_lib_int_pow2 should have the value 202002L in c++26"193# endif194 195#endif // TEST_STD_VER > 23196 197// clang-format on198