207 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// WARNING: This test was generated by generate_feature_test_macro_components.py10// and should not be edited manually.11 12// <cmath>13 14// Test the feature test macros defined by <cmath>15 16// clang-format off17 18#include <cmath>19#include "test_macros.h"20 21#if TEST_STD_VER < 1422 23# ifdef __cpp_lib_constexpr_cmath24# error "__cpp_lib_constexpr_cmath should not be defined before c++23"25# endif26 27# ifdef __cpp_lib_hypot28# error "__cpp_lib_hypot should not be defined before c++17"29# endif30 31# ifdef __cpp_lib_interpolate32# error "__cpp_lib_interpolate should not be defined before c++20"33# endif34 35# ifdef __cpp_lib_math_special_functions36# error "__cpp_lib_math_special_functions should not be defined before c++17"37# endif38 39#elif TEST_STD_VER == 1440 41# ifdef __cpp_lib_constexpr_cmath42# error "__cpp_lib_constexpr_cmath should not be defined before c++23"43# endif44 45# ifdef __cpp_lib_hypot46# error "__cpp_lib_hypot should not be defined before c++17"47# endif48 49# ifdef __cpp_lib_interpolate50# error "__cpp_lib_interpolate should not be defined before c++20"51# endif52 53# ifdef __cpp_lib_math_special_functions54# error "__cpp_lib_math_special_functions should not be defined before c++17"55# endif56 57#elif TEST_STD_VER == 1758 59# ifdef __cpp_lib_constexpr_cmath60# error "__cpp_lib_constexpr_cmath should not be defined before c++23"61# endif62 63# ifndef __cpp_lib_hypot64# error "__cpp_lib_hypot should be defined in c++17"65# endif66# if __cpp_lib_hypot != 201603L67# error "__cpp_lib_hypot should have the value 201603L in c++17"68# endif69 70# ifdef __cpp_lib_interpolate71# error "__cpp_lib_interpolate should not be defined before c++20"72# endif73 74# if !defined(_LIBCPP_VERSION)75# ifndef __cpp_lib_math_special_functions76# error "__cpp_lib_math_special_functions should be defined in c++17"77# endif78# if __cpp_lib_math_special_functions != 201603L79# error "__cpp_lib_math_special_functions should have the value 201603L in c++17"80# endif81# else82# ifdef __cpp_lib_math_special_functions83# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"84# endif85# endif86 87#elif TEST_STD_VER == 2088 89# ifdef __cpp_lib_constexpr_cmath90# error "__cpp_lib_constexpr_cmath should not be defined before c++23"91# endif92 93# ifndef __cpp_lib_hypot94# error "__cpp_lib_hypot should be defined in c++20"95# endif96# if __cpp_lib_hypot != 201603L97# error "__cpp_lib_hypot should have the value 201603L in c++20"98# endif99 100# ifndef __cpp_lib_interpolate101# error "__cpp_lib_interpolate should be defined in c++20"102# endif103# if __cpp_lib_interpolate != 201902L104# error "__cpp_lib_interpolate should have the value 201902L in c++20"105# endif106 107# if !defined(_LIBCPP_VERSION)108# ifndef __cpp_lib_math_special_functions109# error "__cpp_lib_math_special_functions should be defined in c++20"110# endif111# if __cpp_lib_math_special_functions != 201603L112# error "__cpp_lib_math_special_functions should have the value 201603L in c++20"113# endif114# else115# ifdef __cpp_lib_math_special_functions116# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"117# endif118# endif119 120#elif TEST_STD_VER == 23121 122# if !defined(_LIBCPP_VERSION)123# ifndef __cpp_lib_constexpr_cmath124# error "__cpp_lib_constexpr_cmath should be defined in c++23"125# endif126# if __cpp_lib_constexpr_cmath != 202202L127# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23"128# endif129# else130# ifdef __cpp_lib_constexpr_cmath131# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"132# endif133# endif134 135# ifndef __cpp_lib_hypot136# error "__cpp_lib_hypot should be defined in c++23"137# endif138# if __cpp_lib_hypot != 201603L139# error "__cpp_lib_hypot should have the value 201603L in c++23"140# endif141 142# ifndef __cpp_lib_interpolate143# error "__cpp_lib_interpolate should be defined in c++23"144# endif145# if __cpp_lib_interpolate != 201902L146# error "__cpp_lib_interpolate should have the value 201902L in c++23"147# endif148 149# if !defined(_LIBCPP_VERSION)150# ifndef __cpp_lib_math_special_functions151# error "__cpp_lib_math_special_functions should be defined in c++23"152# endif153# if __cpp_lib_math_special_functions != 201603L154# error "__cpp_lib_math_special_functions should have the value 201603L in c++23"155# endif156# else157# ifdef __cpp_lib_math_special_functions158# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"159# endif160# endif161 162#elif TEST_STD_VER > 23163 164# if !defined(_LIBCPP_VERSION)165# ifndef __cpp_lib_constexpr_cmath166# error "__cpp_lib_constexpr_cmath should be defined in c++26"167# endif168# if __cpp_lib_constexpr_cmath != 202202L169# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26"170# endif171# else172# ifdef __cpp_lib_constexpr_cmath173# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"174# endif175# endif176 177# ifndef __cpp_lib_hypot178# error "__cpp_lib_hypot should be defined in c++26"179# endif180# if __cpp_lib_hypot != 201603L181# error "__cpp_lib_hypot should have the value 201603L in c++26"182# endif183 184# ifndef __cpp_lib_interpolate185# error "__cpp_lib_interpolate should be defined in c++26"186# endif187# if __cpp_lib_interpolate != 201902L188# error "__cpp_lib_interpolate should have the value 201902L in c++26"189# endif190 191# if !defined(_LIBCPP_VERSION)192# ifndef __cpp_lib_math_special_functions193# error "__cpp_lib_math_special_functions should be defined in c++26"194# endif195# if __cpp_lib_math_special_functions != 201603L196# error "__cpp_lib_math_special_functions should have the value 201603L in c++26"197# endif198# else199# ifdef __cpp_lib_math_special_functions200# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!"201# endif202# endif203 204#endif // TEST_STD_VER > 23205 206// clang-format on207