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