| 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 | // <cstdlib> |
| 13 | |
| 14 | // Test the feature test macros defined by <cstdlib> |
| 15 | |
| 16 | // clang-format off |
| 17 | |
| 18 | #include <cstdlib> |
| 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 | #elif TEST_STD_VER == 14 |
| 28 | |
| 29 | # ifdef __cpp_lib_constexpr_cmath |
| 30 | # error "__cpp_lib_constexpr_cmath should not be defined before c++23" |
| 31 | # endif |
| 32 | |
| 33 | #elif TEST_STD_VER == 17 |
| 34 | |
| 35 | # ifdef __cpp_lib_constexpr_cmath |
| 36 | # error "__cpp_lib_constexpr_cmath should not be defined before c++23" |
| 37 | # endif |
| 38 | |
| 39 | #elif TEST_STD_VER == 20 |
| 40 | |
| 41 | # ifdef __cpp_lib_constexpr_cmath |
| 42 | # error "__cpp_lib_constexpr_cmath should not be defined before c++23" |
| 43 | # endif |
| 44 | |
| 45 | #elif TEST_STD_VER == 23 |
| 46 | |
| 47 | # if !defined(_LIBCPP_VERSION) |
| 48 | # ifndef __cpp_lib_constexpr_cmath |
| 49 | # error "__cpp_lib_constexpr_cmath should be defined in c++23" |
| 50 | # endif |
| 51 | # if __cpp_lib_constexpr_cmath != 202202L |
| 52 | # error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23" |
| 53 | # endif |
| 54 | # else |
| 55 | # ifdef __cpp_lib_constexpr_cmath |
| 56 | # error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" |
| 57 | # endif |
| 58 | # endif |
| 59 | |
| 60 | #elif TEST_STD_VER > 23 |
| 61 | |
| 62 | # if !defined(_LIBCPP_VERSION) |
| 63 | # ifndef __cpp_lib_constexpr_cmath |
| 64 | # error "__cpp_lib_constexpr_cmath should be defined in c++26" |
| 65 | # endif |
| 66 | # if __cpp_lib_constexpr_cmath != 202202L |
| 67 | # error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26" |
| 68 | # endif |
| 69 | # else |
| 70 | # ifdef __cpp_lib_constexpr_cmath |
| 71 | # error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" |
| 72 | # endif |
| 73 | # endif |
| 74 | |
| 75 | #endif // TEST_STD_VER > 23 |
| 76 | |
| 77 | // clang-format on |
| 78 | |
| 79 | |