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