libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

numeric.version.pass.cpp (2693B)


      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 // <numeric>
     14 
     15 // Test the feature test macros defined by <numeric>
     16 
     17 /*  Constant                        Value
     18     __cpp_lib_gcd_lcm               201606L [C++17]
     19     __cpp_lib_parallel_algorithm    201603L [C++17]
     20 */
     21 
     22 #include <numeric>
     23 #include "test_macros.h"
     24 
     25 #if TEST_STD_VER < 14
     26 
     27 # ifdef __cpp_lib_gcd_lcm
     28 #   error "__cpp_lib_gcd_lcm should not be defined before c++17"
     29 # endif
     30 
     31 # ifdef __cpp_lib_parallel_algorithm
     32 #   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
     33 # endif
     34 
     35 #elif TEST_STD_VER == 14
     36 
     37 # ifdef __cpp_lib_gcd_lcm
     38 #   error "__cpp_lib_gcd_lcm should not be defined before c++17"
     39 # endif
     40 
     41 # ifdef __cpp_lib_parallel_algorithm
     42 #   error "__cpp_lib_parallel_algorithm should not be defined before c++17"
     43 # endif
     44 
     45 #elif TEST_STD_VER == 17
     46 
     47 # ifndef __cpp_lib_gcd_lcm
     48 #   error "__cpp_lib_gcd_lcm should be defined in c++17"
     49 # endif
     50 # if __cpp_lib_gcd_lcm != 201606L
     51 #   error "__cpp_lib_gcd_lcm should have the value 201606L in c++17"
     52 # endif
     53 
     54 # if !defined(_LIBCPP_VERSION)
     55 #   ifndef __cpp_lib_parallel_algorithm
     56 #     error "__cpp_lib_parallel_algorithm should be defined in c++17"
     57 #   endif
     58 #   if __cpp_lib_parallel_algorithm != 201603L
     59 #     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17"
     60 #   endif
     61 # else // _LIBCPP_VERSION
     62 #   ifdef __cpp_lib_parallel_algorithm
     63 #     error "__cpp_lib_parallel_algorithm 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_gcd_lcm
     70 #   error "__cpp_lib_gcd_lcm should be defined in c++2a"
     71 # endif
     72 # if __cpp_lib_gcd_lcm != 201606L
     73 #   error "__cpp_lib_gcd_lcm should have the value 201606L in c++2a"
     74 # endif
     75 
     76 # if !defined(_LIBCPP_VERSION)
     77 #   ifndef __cpp_lib_parallel_algorithm
     78 #     error "__cpp_lib_parallel_algorithm should be defined in c++2a"
     79 #   endif
     80 #   if __cpp_lib_parallel_algorithm != 201603L
     81 #     error "__cpp_lib_parallel_algorithm should have the value 201603L in c++2a"
     82 #   endif
     83 # else // _LIBCPP_VERSION
     84 #   ifdef __cpp_lib_parallel_algorithm
     85 #     error "__cpp_lib_parallel_algorithm 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() {}