libcxx

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

chrono.version.pass.cpp (2225B)


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