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 // <cstdlib>
152c6217f2SLouis Dionne 
162c6217f2SLouis Dionne // Test the feature test macros defined by <cstdlib>
172c6217f2SLouis Dionne 
182c6217f2SLouis Dionne /*  Constant                     Value
1971400505SMark de Wever     __cpp_lib_constexpr_cmath    202202L [C++23]
202c6217f2SLouis Dionne */
212c6217f2SLouis Dionne 
222c6217f2SLouis Dionne #include <cstdlib>
232c6217f2SLouis Dionne #include "test_macros.h"
242c6217f2SLouis Dionne 
252c6217f2SLouis Dionne #if TEST_STD_VER < 14
262c6217f2SLouis Dionne 
272c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath
2871400505SMark de Wever #   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
292c6217f2SLouis Dionne # endif
302c6217f2SLouis Dionne 
312c6217f2SLouis Dionne #elif TEST_STD_VER == 14
322c6217f2SLouis Dionne 
332c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath
3471400505SMark de Wever #   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
352c6217f2SLouis Dionne # endif
362c6217f2SLouis Dionne 
372c6217f2SLouis Dionne #elif TEST_STD_VER == 17
382c6217f2SLouis Dionne 
392c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath
4071400505SMark de Wever #   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
412c6217f2SLouis Dionne # endif
422c6217f2SLouis Dionne 
432c6217f2SLouis Dionne #elif TEST_STD_VER == 20
442c6217f2SLouis Dionne 
452c6217f2SLouis Dionne # ifdef __cpp_lib_constexpr_cmath
4671400505SMark de Wever #   error "__cpp_lib_constexpr_cmath should not be defined before c++23"
472c6217f2SLouis Dionne # endif
482c6217f2SLouis Dionne 
49*00c97cbcSMark de Wever #elif TEST_STD_VER == 23
502c6217f2SLouis Dionne 
512c6217f2SLouis Dionne # if !defined(_LIBCPP_VERSION)
522c6217f2SLouis Dionne #   ifndef __cpp_lib_constexpr_cmath
5371400505SMark de Wever #     error "__cpp_lib_constexpr_cmath should be defined in c++23"
542c6217f2SLouis Dionne #   endif
552c6217f2SLouis Dionne #   if __cpp_lib_constexpr_cmath != 202202L
5671400505SMark de Wever #     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"
572c6217f2SLouis Dionne #   endif
582c6217f2SLouis Dionne # else // _LIBCPP_VERSION
592c6217f2SLouis Dionne #   ifdef __cpp_lib_constexpr_cmath
602c6217f2SLouis Dionne #     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
612c6217f2SLouis Dionne #   endif
622c6217f2SLouis Dionne # endif
632c6217f2SLouis Dionne 
64*00c97cbcSMark de Wever #elif TEST_STD_VER > 23
65*00c97cbcSMark de Wever 
66*00c97cbcSMark de Wever # if !defined(_LIBCPP_VERSION)
67*00c97cbcSMark de Wever #   ifndef __cpp_lib_constexpr_cmath
68*00c97cbcSMark de Wever #     error "__cpp_lib_constexpr_cmath should be defined in c++26"
69*00c97cbcSMark de Wever #   endif
70*00c97cbcSMark de Wever #   if __cpp_lib_constexpr_cmath != 202202L
71*00c97cbcSMark de Wever #     error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"
72*00c97cbcSMark de Wever #   endif
73*00c97cbcSMark de Wever # else // _LIBCPP_VERSION
74*00c97cbcSMark de Wever #   ifdef __cpp_lib_constexpr_cmath
75*00c97cbcSMark de Wever #     error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
76*00c97cbcSMark de Wever #   endif
77*00c97cbcSMark de Wever # endif
78*00c97cbcSMark de Wever 
79*00c97cbcSMark de Wever #endif // TEST_STD_VER > 23
802c6217f2SLouis Dionne 
81