libcxx

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

shared_mutex.version.pass.cpp (3614B)


      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 // UNSUPPORTED: libcpp-has-no-threads
     14 
     15 // <shared_mutex>
     16 
     17 // Test the feature test macros defined by <shared_mutex>
     18 
     19 /*  Constant                        Value
     20     __cpp_lib_shared_mutex          201505L [C++17]
     21     __cpp_lib_shared_timed_mutex    201402L [C++14]
     22 */
     23 
     24 #include <shared_mutex>
     25 #include "test_macros.h"
     26 
     27 #if TEST_STD_VER < 14
     28 
     29 # ifdef __cpp_lib_shared_mutex
     30 #   error "__cpp_lib_shared_mutex should not be defined before c++17"
     31 # endif
     32 
     33 # ifdef __cpp_lib_shared_timed_mutex
     34 #   error "__cpp_lib_shared_timed_mutex should not be defined before c++14"
     35 # endif
     36 
     37 #elif TEST_STD_VER == 14
     38 
     39 # ifdef __cpp_lib_shared_mutex
     40 #   error "__cpp_lib_shared_mutex should not be defined before c++17"
     41 # endif
     42 
     43 # if !defined(_LIBCPP_HAS_NO_THREADS)
     44 #   ifndef __cpp_lib_shared_timed_mutex
     45 #     error "__cpp_lib_shared_timed_mutex should be defined in c++14"
     46 #   endif
     47 #   if __cpp_lib_shared_timed_mutex != 201402L
     48 #     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++14"
     49 #   endif
     50 # else
     51 #   ifdef __cpp_lib_shared_timed_mutex
     52 #     error "__cpp_lib_shared_timed_mutex should not be defined when !defined(_LIBCPP_HAS_NO_THREADS) is not defined!"
     53 #   endif
     54 # endif
     55 
     56 #elif TEST_STD_VER == 17
     57 
     58 # if !defined(_LIBCPP_HAS_NO_THREADS)
     59 #   ifndef __cpp_lib_shared_mutex
     60 #     error "__cpp_lib_shared_mutex should be defined in c++17"
     61 #   endif
     62 #   if __cpp_lib_shared_mutex != 201505L
     63 #     error "__cpp_lib_shared_mutex should have the value 201505L in c++17"
     64 #   endif
     65 # else
     66 #   ifdef __cpp_lib_shared_mutex
     67 #     error "__cpp_lib_shared_mutex should not be defined when !defined(_LIBCPP_HAS_NO_THREADS) is not defined!"
     68 #   endif
     69 # endif
     70 
     71 # if !defined(_LIBCPP_HAS_NO_THREADS)
     72 #   ifndef __cpp_lib_shared_timed_mutex
     73 #     error "__cpp_lib_shared_timed_mutex should be defined in c++17"
     74 #   endif
     75 #   if __cpp_lib_shared_timed_mutex != 201402L
     76 #     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++17"
     77 #   endif
     78 # else
     79 #   ifdef __cpp_lib_shared_timed_mutex
     80 #     error "__cpp_lib_shared_timed_mutex should not be defined when !defined(_LIBCPP_HAS_NO_THREADS) is not defined!"
     81 #   endif
     82 # endif
     83 
     84 #elif TEST_STD_VER > 17
     85 
     86 # if !defined(_LIBCPP_HAS_NO_THREADS)
     87 #   ifndef __cpp_lib_shared_mutex
     88 #     error "__cpp_lib_shared_mutex should be defined in c++2a"
     89 #   endif
     90 #   if __cpp_lib_shared_mutex != 201505L
     91 #     error "__cpp_lib_shared_mutex should have the value 201505L in c++2a"
     92 #   endif
     93 # else
     94 #   ifdef __cpp_lib_shared_mutex
     95 #     error "__cpp_lib_shared_mutex should not be defined when !defined(_LIBCPP_HAS_NO_THREADS) is not defined!"
     96 #   endif
     97 # endif
     98 
     99 # if !defined(_LIBCPP_HAS_NO_THREADS)
    100 #   ifndef __cpp_lib_shared_timed_mutex
    101 #     error "__cpp_lib_shared_timed_mutex should be defined in c++2a"
    102 #   endif
    103 #   if __cpp_lib_shared_timed_mutex != 201402L
    104 #     error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++2a"
    105 #   endif
    106 # else
    107 #   ifdef __cpp_lib_shared_timed_mutex
    108 #     error "__cpp_lib_shared_timed_mutex should not be defined when !defined(_LIBCPP_HAS_NO_THREADS) is not defined!"
    109 #   endif
    110 # endif
    111 
    112 #endif // TEST_STD_VER > 17
    113 
    114 int main() {}