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 // <cmath> 152c6217f2SLouis Dionne 162c6217f2SLouis Dionne // Test the feature test macros defined by <cmath> 172c6217f2SLouis Dionne 182c6217f2SLouis Dionne /* Constant Value 1971400505SMark de Wever __cpp_lib_constexpr_cmath 202202L [C++23] 202c6217f2SLouis Dionne __cpp_lib_hypot 201603L [C++17] 212c6217f2SLouis Dionne __cpp_lib_interpolate 201902L [C++20] 222c6217f2SLouis Dionne __cpp_lib_math_special_functions 201603L [C++17] 232c6217f2SLouis Dionne */ 242c6217f2SLouis Dionne 252c6217f2SLouis Dionne #include <cmath> 262c6217f2SLouis Dionne #include "test_macros.h" 272c6217f2SLouis Dionne 282c6217f2SLouis Dionne #if TEST_STD_VER < 14 292c6217f2SLouis Dionne 302c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath 3171400505SMark de Wever # error "__cpp_lib_constexpr_cmath should not be defined before c++23" 322c6217f2SLouis Dionne # endif 332c6217f2SLouis Dionne 342c6217f2SLouis Dionne # ifdef __cpp_lib_hypot 352c6217f2SLouis Dionne # error "__cpp_lib_hypot should not be defined before c++17" 362c6217f2SLouis Dionne # endif 372c6217f2SLouis Dionne 382c6217f2SLouis Dionne # ifdef __cpp_lib_interpolate 392c6217f2SLouis Dionne # error "__cpp_lib_interpolate should not be defined before c++20" 402c6217f2SLouis Dionne # endif 412c6217f2SLouis Dionne 422c6217f2SLouis Dionne # ifdef __cpp_lib_math_special_functions 432c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should not be defined before c++17" 442c6217f2SLouis Dionne # endif 452c6217f2SLouis Dionne 462c6217f2SLouis Dionne #elif TEST_STD_VER == 14 472c6217f2SLouis Dionne 482c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath 4971400505SMark de Wever # error "__cpp_lib_constexpr_cmath should not be defined before c++23" 502c6217f2SLouis Dionne # endif 512c6217f2SLouis Dionne 522c6217f2SLouis Dionne # ifdef __cpp_lib_hypot 532c6217f2SLouis Dionne # error "__cpp_lib_hypot should not be defined before c++17" 542c6217f2SLouis Dionne # endif 552c6217f2SLouis Dionne 562c6217f2SLouis Dionne # ifdef __cpp_lib_interpolate 572c6217f2SLouis Dionne # error "__cpp_lib_interpolate should not be defined before c++20" 582c6217f2SLouis Dionne # endif 592c6217f2SLouis Dionne 602c6217f2SLouis Dionne # ifdef __cpp_lib_math_special_functions 612c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should not be defined before c++17" 622c6217f2SLouis Dionne # endif 632c6217f2SLouis Dionne 642c6217f2SLouis Dionne #elif TEST_STD_VER == 17 652c6217f2SLouis Dionne 662c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath 6771400505SMark de Wever # error "__cpp_lib_constexpr_cmath should not be defined before c++23" 682c6217f2SLouis Dionne # endif 692c6217f2SLouis Dionne 702c6217f2SLouis Dionne # ifndef __cpp_lib_hypot 712c6217f2SLouis Dionne # error "__cpp_lib_hypot should be defined in c++17" 722c6217f2SLouis Dionne # endif 732c6217f2SLouis Dionne # if __cpp_lib_hypot != 201603L 742c6217f2SLouis Dionne # error "__cpp_lib_hypot should have the value 201603L in c++17" 752c6217f2SLouis Dionne # endif 762c6217f2SLouis Dionne 772c6217f2SLouis Dionne # ifdef __cpp_lib_interpolate 782c6217f2SLouis Dionne # error "__cpp_lib_interpolate should not be defined before c++20" 792c6217f2SLouis Dionne # endif 802c6217f2SLouis Dionne 812c6217f2SLouis Dionne # if !defined(_LIBCPP_VERSION) 822c6217f2SLouis Dionne # ifndef __cpp_lib_math_special_functions 832c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should be defined in c++17" 842c6217f2SLouis Dionne # endif 852c6217f2SLouis Dionne # if __cpp_lib_math_special_functions != 201603L 862c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should have the value 201603L in c++17" 872c6217f2SLouis Dionne # endif 882c6217f2SLouis Dionne # else // _LIBCPP_VERSION 892c6217f2SLouis Dionne # ifdef __cpp_lib_math_special_functions 902c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" 912c6217f2SLouis Dionne # endif 922c6217f2SLouis Dionne # endif 932c6217f2SLouis Dionne 942c6217f2SLouis Dionne #elif TEST_STD_VER == 20 952c6217f2SLouis Dionne 962c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath 9771400505SMark de Wever # error "__cpp_lib_constexpr_cmath should not be defined before c++23" 982c6217f2SLouis Dionne # endif 992c6217f2SLouis Dionne 1002c6217f2SLouis Dionne # ifndef __cpp_lib_hypot 1012c6217f2SLouis Dionne # error "__cpp_lib_hypot should be defined in c++20" 1022c6217f2SLouis Dionne # endif 1032c6217f2SLouis Dionne # if __cpp_lib_hypot != 201603L 1042c6217f2SLouis Dionne # error "__cpp_lib_hypot should have the value 201603L in c++20" 1052c6217f2SLouis Dionne # endif 1062c6217f2SLouis Dionne 1072c6217f2SLouis Dionne # ifndef __cpp_lib_interpolate 1082c6217f2SLouis Dionne # error "__cpp_lib_interpolate should be defined in c++20" 1092c6217f2SLouis Dionne # endif 1102c6217f2SLouis Dionne # if __cpp_lib_interpolate != 201902L 1112c6217f2SLouis Dionne # error "__cpp_lib_interpolate should have the value 201902L in c++20" 1122c6217f2SLouis Dionne # endif 1132c6217f2SLouis Dionne 1142c6217f2SLouis Dionne # if !defined(_LIBCPP_VERSION) 1152c6217f2SLouis Dionne # ifndef __cpp_lib_math_special_functions 1162c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should be defined in c++20" 1172c6217f2SLouis Dionne # endif 1182c6217f2SLouis Dionne # if __cpp_lib_math_special_functions != 201603L 1192c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should have the value 201603L in c++20" 1202c6217f2SLouis Dionne # endif 1212c6217f2SLouis Dionne # else // _LIBCPP_VERSION 1222c6217f2SLouis Dionne # ifdef __cpp_lib_math_special_functions 1232c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" 1242c6217f2SLouis Dionne # endif 1252c6217f2SLouis Dionne # endif 1262c6217f2SLouis Dionne 127*00c97cbcSMark de Wever #elif TEST_STD_VER == 23 1282c6217f2SLouis Dionne 1292c6217f2SLouis Dionne # if !defined(_LIBCPP_VERSION) 1302c6217f2SLouis Dionne # ifndef __cpp_lib_constexpr_cmath 13171400505SMark de Wever # error "__cpp_lib_constexpr_cmath should be defined in c++23" 1322c6217f2SLouis Dionne # endif 1332c6217f2SLouis Dionne # if __cpp_lib_constexpr_cmath != 202202L 13471400505SMark de Wever # error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23" 1352c6217f2SLouis Dionne # endif 1362c6217f2SLouis Dionne # else // _LIBCPP_VERSION 1372c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath 1382c6217f2SLouis Dionne # error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" 1392c6217f2SLouis Dionne # endif 1402c6217f2SLouis Dionne # endif 1412c6217f2SLouis Dionne 1422c6217f2SLouis Dionne # ifndef __cpp_lib_hypot 14371400505SMark de Wever # error "__cpp_lib_hypot should be defined in c++23" 1442c6217f2SLouis Dionne # endif 1452c6217f2SLouis Dionne # if __cpp_lib_hypot != 201603L 14671400505SMark de Wever # error "__cpp_lib_hypot should have the value 201603L in c++23" 1472c6217f2SLouis Dionne # endif 1482c6217f2SLouis Dionne 1492c6217f2SLouis Dionne # ifndef __cpp_lib_interpolate 15071400505SMark de Wever # error "__cpp_lib_interpolate should be defined in c++23" 1512c6217f2SLouis Dionne # endif 1522c6217f2SLouis Dionne # if __cpp_lib_interpolate != 201902L 15371400505SMark de Wever # error "__cpp_lib_interpolate should have the value 201902L in c++23" 1542c6217f2SLouis Dionne # endif 1552c6217f2SLouis Dionne 1562c6217f2SLouis Dionne # if !defined(_LIBCPP_VERSION) 1572c6217f2SLouis Dionne # ifndef __cpp_lib_math_special_functions 15871400505SMark de Wever # error "__cpp_lib_math_special_functions should be defined in c++23" 1592c6217f2SLouis Dionne # endif 1602c6217f2SLouis Dionne # if __cpp_lib_math_special_functions != 201603L 16171400505SMark de Wever # error "__cpp_lib_math_special_functions should have the value 201603L in c++23" 1622c6217f2SLouis Dionne # endif 1632c6217f2SLouis Dionne # else // _LIBCPP_VERSION 1642c6217f2SLouis Dionne # ifdef __cpp_lib_math_special_functions 1652c6217f2SLouis Dionne # error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" 1662c6217f2SLouis Dionne # endif 1672c6217f2SLouis Dionne # endif 1682c6217f2SLouis Dionne 169*00c97cbcSMark de Wever #elif TEST_STD_VER > 23 170*00c97cbcSMark de Wever 171*00c97cbcSMark de Wever # if !defined(_LIBCPP_VERSION) 172*00c97cbcSMark de Wever # ifndef __cpp_lib_constexpr_cmath 173*00c97cbcSMark de Wever # error "__cpp_lib_constexpr_cmath should be defined in c++26" 174*00c97cbcSMark de Wever # endif 175*00c97cbcSMark de Wever # if __cpp_lib_constexpr_cmath != 202202L 176*00c97cbcSMark de Wever # error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26" 177*00c97cbcSMark de Wever # endif 178*00c97cbcSMark de Wever # else // _LIBCPP_VERSION 179*00c97cbcSMark de Wever # ifdef __cpp_lib_constexpr_cmath 180*00c97cbcSMark de Wever # error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" 181*00c97cbcSMark de Wever # endif 182*00c97cbcSMark de Wever # endif 183*00c97cbcSMark de Wever 184*00c97cbcSMark de Wever # ifndef __cpp_lib_hypot 185*00c97cbcSMark de Wever # error "__cpp_lib_hypot should be defined in c++26" 186*00c97cbcSMark de Wever # endif 187*00c97cbcSMark de Wever # if __cpp_lib_hypot != 201603L 188*00c97cbcSMark de Wever # error "__cpp_lib_hypot should have the value 201603L in c++26" 189*00c97cbcSMark de Wever # endif 190*00c97cbcSMark de Wever 191*00c97cbcSMark de Wever # ifndef __cpp_lib_interpolate 192*00c97cbcSMark de Wever # error "__cpp_lib_interpolate should be defined in c++26" 193*00c97cbcSMark de Wever # endif 194*00c97cbcSMark de Wever # if __cpp_lib_interpolate != 201902L 195*00c97cbcSMark de Wever # error "__cpp_lib_interpolate should have the value 201902L in c++26" 196*00c97cbcSMark de Wever # endif 197*00c97cbcSMark de Wever 198*00c97cbcSMark de Wever # if !defined(_LIBCPP_VERSION) 199*00c97cbcSMark de Wever # ifndef __cpp_lib_math_special_functions 200*00c97cbcSMark de Wever # error "__cpp_lib_math_special_functions should be defined in c++26" 201*00c97cbcSMark de Wever # endif 202*00c97cbcSMark de Wever # if __cpp_lib_math_special_functions != 201603L 203*00c97cbcSMark de Wever # error "__cpp_lib_math_special_functions should have the value 201603L in c++26" 204*00c97cbcSMark de Wever # endif 205*00c97cbcSMark de Wever # else // _LIBCPP_VERSION 206*00c97cbcSMark de Wever # ifdef __cpp_lib_math_special_functions 207*00c97cbcSMark de Wever # error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" 208*00c97cbcSMark de Wever # endif 209*00c97cbcSMark de Wever # endif 210*00c97cbcSMark de Wever 211*00c97cbcSMark de Wever #endif // TEST_STD_VER > 23 2122c6217f2SLouis Dionne 213