182 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-filesystem13 14// <filesystem>15 16// Test the feature test macros defined by <filesystem>17 18// clang-format off19 20#include <filesystem>21#include "test_macros.h"22 23#if TEST_STD_VER < 1424 25# ifdef __cpp_lib_char8_t26# error "__cpp_lib_char8_t should not be defined before c++20"27# endif28 29# ifdef __cpp_lib_filesystem30# error "__cpp_lib_filesystem should not be defined before c++17"31# endif32 33# ifdef __cpp_lib_format_path34# error "__cpp_lib_format_path should not be defined before c++26"35# endif36 37#elif TEST_STD_VER == 1438 39# ifdef __cpp_lib_char8_t40# error "__cpp_lib_char8_t should not be defined before c++20"41# endif42 43# ifdef __cpp_lib_filesystem44# error "__cpp_lib_filesystem should not be defined before c++17"45# endif46 47# ifdef __cpp_lib_format_path48# error "__cpp_lib_format_path should not be defined before c++26"49# endif50 51#elif TEST_STD_VER == 1752 53# ifdef __cpp_lib_char8_t54# error "__cpp_lib_char8_t should not be defined before c++20"55# endif56 57# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM58# ifndef __cpp_lib_filesystem59# error "__cpp_lib_filesystem should be defined in c++17"60# endif61# if __cpp_lib_filesystem != 201703L62# error "__cpp_lib_filesystem should have the value 201703L in c++17"63# endif64# else65# ifdef __cpp_lib_filesystem66# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM' is not met!"67# endif68# endif69 70# ifdef __cpp_lib_format_path71# error "__cpp_lib_format_path should not be defined before c++26"72# endif73 74#elif TEST_STD_VER == 2075 76# if defined(__cpp_char8_t)77# ifndef __cpp_lib_char8_t78# error "__cpp_lib_char8_t should be defined in c++20"79# endif80# if __cpp_lib_char8_t != 201907L81# error "__cpp_lib_char8_t should have the value 201907L in c++20"82# endif83# else84# ifdef __cpp_lib_char8_t85# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"86# endif87# endif88 89# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM90# ifndef __cpp_lib_filesystem91# error "__cpp_lib_filesystem should be defined in c++20"92# endif93# if __cpp_lib_filesystem != 201703L94# error "__cpp_lib_filesystem should have the value 201703L in c++20"95# endif96# else97# ifdef __cpp_lib_filesystem98# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM' is not met!"99# endif100# endif101 102# ifdef __cpp_lib_format_path103# error "__cpp_lib_format_path should not be defined before c++26"104# endif105 106#elif TEST_STD_VER == 23107 108# if defined(__cpp_char8_t)109# ifndef __cpp_lib_char8_t110# error "__cpp_lib_char8_t should be defined in c++23"111# endif112# if __cpp_lib_char8_t != 201907L113# error "__cpp_lib_char8_t should have the value 201907L in c++23"114# endif115# else116# ifdef __cpp_lib_char8_t117# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"118# endif119# endif120 121# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM122# ifndef __cpp_lib_filesystem123# error "__cpp_lib_filesystem should be defined in c++23"124# endif125# if __cpp_lib_filesystem != 201703L126# error "__cpp_lib_filesystem should have the value 201703L in c++23"127# endif128# else129# ifdef __cpp_lib_filesystem130# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM' is not met!"131# endif132# endif133 134# ifdef __cpp_lib_format_path135# error "__cpp_lib_format_path should not be defined before c++26"136# endif137 138#elif TEST_STD_VER > 23139 140# if defined(__cpp_char8_t)141# ifndef __cpp_lib_char8_t142# error "__cpp_lib_char8_t should be defined in c++26"143# endif144# if __cpp_lib_char8_t != 201907L145# error "__cpp_lib_char8_t should have the value 201907L in c++26"146# endif147# else148# ifdef __cpp_lib_char8_t149# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"150# endif151# endif152 153# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM154# ifndef __cpp_lib_filesystem155# error "__cpp_lib_filesystem should be defined in c++26"156# endif157# if __cpp_lib_filesystem != 201703L158# error "__cpp_lib_filesystem should have the value 201703L in c++26"159# endif160# else161# ifdef __cpp_lib_filesystem162# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM' is not met!"163# endif164# endif165 166# if !defined(_LIBCPP_VERSION)167# ifndef __cpp_lib_format_path168# error "__cpp_lib_format_path should be defined in c++26"169# endif170# if __cpp_lib_format_path != 202403L171# error "__cpp_lib_format_path should have the value 202403L in c++26"172# endif173# else174# ifdef __cpp_lib_format_path175# error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!"176# endif177# endif178 179#endif // TEST_STD_VER > 23180 181// clang-format on182