brintos

brintos / llvm-project-archived public Read only

0
0
Text · 13.1 KiB · 8bd0274 Raw
405 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// <atomic>13 14// Test the feature test macros defined by <atomic>15 16// clang-format off17 18#include <atomic>19#include "test_macros.h"20 21#if TEST_STD_VER < 1422 23#  ifdef __cpp_lib_atomic_flag_test24#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"25#  endif26 27#  ifdef __cpp_lib_atomic_float28#    error "__cpp_lib_atomic_float should not be defined before c++20"29#  endif30 31#  ifdef __cpp_lib_atomic_is_always_lock_free32#    error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"33#  endif34 35#  ifdef __cpp_lib_atomic_lock_free_type_aliases36#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"37#  endif38 39#  ifdef __cpp_lib_atomic_min_max40#    error "__cpp_lib_atomic_min_max should not be defined before c++26"41#  endif42 43#  ifdef __cpp_lib_atomic_ref44#    error "__cpp_lib_atomic_ref should not be defined before c++20"45#  endif46 47#  ifdef __cpp_lib_atomic_shared_ptr48#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"49#  endif50 51#  ifdef __cpp_lib_atomic_value_initialization52#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"53#  endif54 55#  ifdef __cpp_lib_atomic_wait56#    error "__cpp_lib_atomic_wait should not be defined before c++20"57#  endif58 59#  ifdef __cpp_lib_char8_t60#    error "__cpp_lib_char8_t should not be defined before c++20"61#  endif62 63#elif TEST_STD_VER == 1464 65#  ifdef __cpp_lib_atomic_flag_test66#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"67#  endif68 69#  ifdef __cpp_lib_atomic_float70#    error "__cpp_lib_atomic_float should not be defined before c++20"71#  endif72 73#  ifdef __cpp_lib_atomic_is_always_lock_free74#    error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17"75#  endif76 77#  ifdef __cpp_lib_atomic_lock_free_type_aliases78#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"79#  endif80 81#  ifdef __cpp_lib_atomic_min_max82#    error "__cpp_lib_atomic_min_max should not be defined before c++26"83#  endif84 85#  ifdef __cpp_lib_atomic_ref86#    error "__cpp_lib_atomic_ref should not be defined before c++20"87#  endif88 89#  ifdef __cpp_lib_atomic_shared_ptr90#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"91#  endif92 93#  ifdef __cpp_lib_atomic_value_initialization94#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"95#  endif96 97#  ifdef __cpp_lib_atomic_wait98#    error "__cpp_lib_atomic_wait should not be defined before c++20"99#  endif100 101#  ifdef __cpp_lib_char8_t102#    error "__cpp_lib_char8_t should not be defined before c++20"103#  endif104 105#elif TEST_STD_VER == 17106 107#  ifdef __cpp_lib_atomic_flag_test108#    error "__cpp_lib_atomic_flag_test should not be defined before c++20"109#  endif110 111#  ifdef __cpp_lib_atomic_float112#    error "__cpp_lib_atomic_float should not be defined before c++20"113#  endif114 115#  ifndef __cpp_lib_atomic_is_always_lock_free116#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++17"117#  endif118#  if __cpp_lib_atomic_is_always_lock_free != 201603L119#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++17"120#  endif121 122#  ifdef __cpp_lib_atomic_lock_free_type_aliases123#    error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20"124#  endif125 126#  ifdef __cpp_lib_atomic_min_max127#    error "__cpp_lib_atomic_min_max should not be defined before c++26"128#  endif129 130#  ifdef __cpp_lib_atomic_ref131#    error "__cpp_lib_atomic_ref should not be defined before c++20"132#  endif133 134#  ifdef __cpp_lib_atomic_shared_ptr135#    error "__cpp_lib_atomic_shared_ptr should not be defined before c++20"136#  endif137 138#  ifdef __cpp_lib_atomic_value_initialization139#    error "__cpp_lib_atomic_value_initialization should not be defined before c++20"140#  endif141 142#  ifdef __cpp_lib_atomic_wait143#    error "__cpp_lib_atomic_wait should not be defined before c++20"144#  endif145 146#  ifdef __cpp_lib_char8_t147#    error "__cpp_lib_char8_t should not be defined before c++20"148#  endif149 150#elif TEST_STD_VER == 20151 152#  ifndef __cpp_lib_atomic_flag_test153#    error "__cpp_lib_atomic_flag_test should be defined in c++20"154#  endif155#  if __cpp_lib_atomic_flag_test != 201907L156#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20"157#  endif158 159#  ifndef __cpp_lib_atomic_float160#    error "__cpp_lib_atomic_float should be defined in c++20"161#  endif162#  if __cpp_lib_atomic_float != 201711L163#    error "__cpp_lib_atomic_float should have the value 201711L in c++20"164#  endif165 166#  ifndef __cpp_lib_atomic_is_always_lock_free167#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++20"168#  endif169#  if __cpp_lib_atomic_is_always_lock_free != 201603L170#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++20"171#  endif172 173#  ifndef __cpp_lib_atomic_lock_free_type_aliases174#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++20"175#  endif176#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L177#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++20"178#  endif179 180#  ifdef __cpp_lib_atomic_min_max181#    error "__cpp_lib_atomic_min_max should not be defined before c++26"182#  endif183 184#  ifndef __cpp_lib_atomic_ref185#    error "__cpp_lib_atomic_ref should be defined in c++20"186#  endif187#  if __cpp_lib_atomic_ref != 201806L188#    error "__cpp_lib_atomic_ref should have the value 201806L in c++20"189#  endif190 191#  if !defined(_LIBCPP_VERSION)192#    ifndef __cpp_lib_atomic_shared_ptr193#      error "__cpp_lib_atomic_shared_ptr should be defined in c++20"194#    endif195#    if __cpp_lib_atomic_shared_ptr != 201711L196#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++20"197#    endif198#  else199#    ifdef __cpp_lib_atomic_shared_ptr200#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"201#    endif202#  endif203 204#  ifndef __cpp_lib_atomic_value_initialization205#    error "__cpp_lib_atomic_value_initialization should be defined in c++20"206#  endif207#  if __cpp_lib_atomic_value_initialization != 201911L208#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20"209#  endif210 211#  ifndef __cpp_lib_atomic_wait212#    error "__cpp_lib_atomic_wait should be defined in c++20"213#  endif214#  if __cpp_lib_atomic_wait != 201907L215#    error "__cpp_lib_atomic_wait should have the value 201907L in c++20"216#  endif217 218#  if defined(__cpp_char8_t)219#    ifndef __cpp_lib_char8_t220#      error "__cpp_lib_char8_t should be defined in c++20"221#    endif222#    if __cpp_lib_char8_t != 201907L223#      error "__cpp_lib_char8_t should have the value 201907L in c++20"224#    endif225#  else226#    ifdef __cpp_lib_char8_t227#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"228#    endif229#  endif230 231#elif TEST_STD_VER == 23232 233#  ifndef __cpp_lib_atomic_flag_test234#    error "__cpp_lib_atomic_flag_test should be defined in c++23"235#  endif236#  if __cpp_lib_atomic_flag_test != 201907L237#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23"238#  endif239 240#  ifndef __cpp_lib_atomic_float241#    error "__cpp_lib_atomic_float should be defined in c++23"242#  endif243#  if __cpp_lib_atomic_float != 201711L244#    error "__cpp_lib_atomic_float should have the value 201711L in c++23"245#  endif246 247#  ifndef __cpp_lib_atomic_is_always_lock_free248#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++23"249#  endif250#  if __cpp_lib_atomic_is_always_lock_free != 201603L251#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++23"252#  endif253 254#  ifndef __cpp_lib_atomic_lock_free_type_aliases255#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++23"256#  endif257#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L258#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++23"259#  endif260 261#  ifdef __cpp_lib_atomic_min_max262#    error "__cpp_lib_atomic_min_max should not be defined before c++26"263#  endif264 265#  ifndef __cpp_lib_atomic_ref266#    error "__cpp_lib_atomic_ref should be defined in c++23"267#  endif268#  if __cpp_lib_atomic_ref != 201806L269#    error "__cpp_lib_atomic_ref should have the value 201806L in c++23"270#  endif271 272#  if !defined(_LIBCPP_VERSION)273#    ifndef __cpp_lib_atomic_shared_ptr274#      error "__cpp_lib_atomic_shared_ptr should be defined in c++23"275#    endif276#    if __cpp_lib_atomic_shared_ptr != 201711L277#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++23"278#    endif279#  else280#    ifdef __cpp_lib_atomic_shared_ptr281#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"282#    endif283#  endif284 285#  ifndef __cpp_lib_atomic_value_initialization286#    error "__cpp_lib_atomic_value_initialization should be defined in c++23"287#  endif288#  if __cpp_lib_atomic_value_initialization != 201911L289#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23"290#  endif291 292#  ifndef __cpp_lib_atomic_wait293#    error "__cpp_lib_atomic_wait should be defined in c++23"294#  endif295#  if __cpp_lib_atomic_wait != 201907L296#    error "__cpp_lib_atomic_wait should have the value 201907L in c++23"297#  endif298 299#  if defined(__cpp_char8_t)300#    ifndef __cpp_lib_char8_t301#      error "__cpp_lib_char8_t should be defined in c++23"302#    endif303#    if __cpp_lib_char8_t != 201907L304#      error "__cpp_lib_char8_t should have the value 201907L in c++23"305#    endif306#  else307#    ifdef __cpp_lib_char8_t308#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"309#    endif310#  endif311 312#elif TEST_STD_VER > 23313 314#  ifndef __cpp_lib_atomic_flag_test315#    error "__cpp_lib_atomic_flag_test should be defined in c++26"316#  endif317#  if __cpp_lib_atomic_flag_test != 201907L318#    error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26"319#  endif320 321#  ifndef __cpp_lib_atomic_float322#    error "__cpp_lib_atomic_float should be defined in c++26"323#  endif324#  if __cpp_lib_atomic_float != 201711L325#    error "__cpp_lib_atomic_float should have the value 201711L in c++26"326#  endif327 328#  ifndef __cpp_lib_atomic_is_always_lock_free329#    error "__cpp_lib_atomic_is_always_lock_free should be defined in c++26"330#  endif331#  if __cpp_lib_atomic_is_always_lock_free != 201603L332#    error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++26"333#  endif334 335#  ifndef __cpp_lib_atomic_lock_free_type_aliases336#    error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++26"337#  endif338#  if __cpp_lib_atomic_lock_free_type_aliases != 201907L339#    error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++26"340#  endif341 342#  if !defined(_LIBCPP_VERSION)343#    ifndef __cpp_lib_atomic_min_max344#      error "__cpp_lib_atomic_min_max should be defined in c++26"345#    endif346#    if __cpp_lib_atomic_min_max != 202403L347#      error "__cpp_lib_atomic_min_max should have the value 202403L in c++26"348#    endif349#  else350#    ifdef __cpp_lib_atomic_min_max351#      error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!"352#    endif353#  endif354 355#  ifndef __cpp_lib_atomic_ref356#    error "__cpp_lib_atomic_ref should be defined in c++26"357#  endif358#  if __cpp_lib_atomic_ref != 202411L359#    error "__cpp_lib_atomic_ref should have the value 202411L in c++26"360#  endif361 362#  if !defined(_LIBCPP_VERSION)363#    ifndef __cpp_lib_atomic_shared_ptr364#      error "__cpp_lib_atomic_shared_ptr should be defined in c++26"365#    endif366#    if __cpp_lib_atomic_shared_ptr != 201711L367#      error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++26"368#    endif369#  else370#    ifdef __cpp_lib_atomic_shared_ptr371#      error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!"372#    endif373#  endif374 375#  ifndef __cpp_lib_atomic_value_initialization376#    error "__cpp_lib_atomic_value_initialization should be defined in c++26"377#  endif378#  if __cpp_lib_atomic_value_initialization != 201911L379#    error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26"380#  endif381 382#  ifndef __cpp_lib_atomic_wait383#    error "__cpp_lib_atomic_wait should be defined in c++26"384#  endif385#  if __cpp_lib_atomic_wait != 201907L386#    error "__cpp_lib_atomic_wait should have the value 201907L in c++26"387#  endif388 389#  if defined(__cpp_char8_t)390#    ifndef __cpp_lib_char8_t391#      error "__cpp_lib_char8_t should be defined in c++26"392#    endif393#    if __cpp_lib_char8_t != 201907L394#      error "__cpp_lib_char8_t should have the value 201907L in c++26"395#    endif396#  else397#    ifdef __cpp_lib_char8_t398#      error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"399#    endif400#  endif401 402#endif // TEST_STD_VER > 23403 404// clang-format on405