98 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// <mutex>15 16// Test the feature test macros defined by <mutex>17 18// clang-format off19 20#include <mutex>21#include "test_macros.h"22 23#if TEST_STD_VER < 1424 25# ifdef __cpp_lib_scoped_lock26# error "__cpp_lib_scoped_lock should not be defined before c++17"27# endif28 29#elif TEST_STD_VER == 1430 31# ifdef __cpp_lib_scoped_lock32# error "__cpp_lib_scoped_lock should not be defined before c++17"33# endif34 35#elif TEST_STD_VER == 1736 37# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS38# ifndef __cpp_lib_scoped_lock39# error "__cpp_lib_scoped_lock should be defined in c++17"40# endif41# if __cpp_lib_scoped_lock != 201703L42# error "__cpp_lib_scoped_lock should have the value 201703L in c++17"43# endif44# else45# ifdef __cpp_lib_scoped_lock46# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"47# endif48# endif49 50#elif TEST_STD_VER == 2051 52# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS53# ifndef __cpp_lib_scoped_lock54# error "__cpp_lib_scoped_lock should be defined in c++20"55# endif56# if __cpp_lib_scoped_lock != 201703L57# error "__cpp_lib_scoped_lock should have the value 201703L in c++20"58# endif59# else60# ifdef __cpp_lib_scoped_lock61# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"62# endif63# endif64 65#elif TEST_STD_VER == 2366 67# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS68# ifndef __cpp_lib_scoped_lock69# error "__cpp_lib_scoped_lock should be defined in c++23"70# endif71# if __cpp_lib_scoped_lock != 201703L72# error "__cpp_lib_scoped_lock should have the value 201703L in c++23"73# endif74# else75# ifdef __cpp_lib_scoped_lock76# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"77# endif78# endif79 80#elif TEST_STD_VER > 2381 82# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS83# ifndef __cpp_lib_scoped_lock84# error "__cpp_lib_scoped_lock should be defined in c++26"85# endif86# if __cpp_lib_scoped_lock != 201703L87# error "__cpp_lib_scoped_lock should have the value 201703L in c++26"88# endif89# else90# ifdef __cpp_lib_scoped_lock91# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!"92# endif93# endif94 95#endif // TEST_STD_VER > 2396 97// clang-format on98