cmath.version.pass.cpp (2739B)
1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // WARNING: This test was generated by generate_feature_test_macro_components.py 11 // and should not be edited manually. 12 13 // <cmath> 14 15 // Test the feature test macros defined by <cmath> 16 17 /* Constant Value 18 __cpp_lib_hypot 201603L [C++17] 19 __cpp_lib_math_special_functions 201603L [C++17] 20 */ 21 22 #include <cmath> 23 #include "test_macros.h" 24 25 #if TEST_STD_VER < 14 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_math_special_functions 32 # error "__cpp_lib_math_special_functions should not be defined before c++17" 33 # endif 34 35 #elif TEST_STD_VER == 14 36 37 # ifdef __cpp_lib_hypot 38 # error "__cpp_lib_hypot should not be defined before c++17" 39 # endif 40 41 # ifdef __cpp_lib_math_special_functions 42 # error "__cpp_lib_math_special_functions should not be defined before c++17" 43 # endif 44 45 #elif TEST_STD_VER == 17 46 47 # ifndef __cpp_lib_hypot 48 # error "__cpp_lib_hypot should be defined in c++17" 49 # endif 50 # if __cpp_lib_hypot != 201603L 51 # error "__cpp_lib_hypot should have the value 201603L in c++17" 52 # endif 53 54 # if !defined(_LIBCPP_VERSION) 55 # ifndef __cpp_lib_math_special_functions 56 # error "__cpp_lib_math_special_functions should be defined in c++17" 57 # endif 58 # if __cpp_lib_math_special_functions != 201603L 59 # error "__cpp_lib_math_special_functions should have the value 201603L in c++17" 60 # endif 61 # else // _LIBCPP_VERSION 62 # ifdef __cpp_lib_math_special_functions 63 # error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" 64 # endif 65 # endif 66 67 #elif TEST_STD_VER > 17 68 69 # ifndef __cpp_lib_hypot 70 # error "__cpp_lib_hypot should be defined in c++2a" 71 # endif 72 # if __cpp_lib_hypot != 201603L 73 # error "__cpp_lib_hypot should have the value 201603L in c++2a" 74 # endif 75 76 # if !defined(_LIBCPP_VERSION) 77 # ifndef __cpp_lib_math_special_functions 78 # error "__cpp_lib_math_special_functions should be defined in c++2a" 79 # endif 80 # if __cpp_lib_math_special_functions != 201603L 81 # error "__cpp_lib_math_special_functions should have the value 201603L in c++2a" 82 # endif 83 # else // _LIBCPP_VERSION 84 # ifdef __cpp_lib_math_special_functions 85 # error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" 86 # endif 87 # endif 88 89 #endif // TEST_STD_VER > 17 90 91 int main() {}