89 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// UNSUPPORTED: no-threads13 14// <latch>15 16// Test the feature test macros defined by <latch>17 18// clang-format off19 20#include <latch>21#include "test_macros.h"22 23#if TEST_STD_VER < 1424 25# ifdef __cpp_lib_latch26# error "__cpp_lib_latch should not be defined before c++20"27# endif28 29#elif TEST_STD_VER == 1430 31# ifdef __cpp_lib_latch32# error "__cpp_lib_latch should not be defined before c++20"33# endif34 35#elif TEST_STD_VER == 1736 37# ifdef __cpp_lib_latch38# error "__cpp_lib_latch should not be defined before c++20"39# endif40 41#elif TEST_STD_VER == 2042 43# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS44# ifndef __cpp_lib_latch45# error "__cpp_lib_latch should be defined in c++20"46# endif47# if __cpp_lib_latch != 201907L48# error "__cpp_lib_latch should have the value 201907L in c++20"49# endif50# else51# ifdef __cpp_lib_latch52# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"53# endif54# endif55 56#elif TEST_STD_VER == 2357 58# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS59# ifndef __cpp_lib_latch60# error "__cpp_lib_latch should be defined in c++23"61# endif62# if __cpp_lib_latch != 201907L63# error "__cpp_lib_latch should have the value 201907L in c++23"64# endif65# else66# ifdef __cpp_lib_latch67# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"68# endif69# endif70 71#elif TEST_STD_VER > 2372 73# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS74# ifndef __cpp_lib_latch75# error "__cpp_lib_latch should be defined in c++26"76# endif77# if __cpp_lib_latch != 201907L78# error "__cpp_lib_latch should have the value 201907L in c++26"79# endif80# else81# ifdef __cpp_lib_latch82# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"83# endif84# endif85 86#endif // TEST_STD_VER > 2387 88// clang-format on89