
Previously, LIBCXX_ENABLE_FILESYSTEM controlled only whether the filesystem support was compiled into libc++'s library. This commit promotes the setting to a first-class option like LIBCXX_ENABLE_LOCALIZATION, where the whole library is aware of the setting and features that depend on <filesystem> won't be provided at all. The test suite is also properly annotated such that tests that depend on <filesystem> are disabled when the library doesn't support it. This is an alternative to https://llvm.org/D94824, but also an improvement along the lines of LIBCXX_ENABLE_LOCALIZATION that I had been wanting to make for a while. Differential Revision: https://reviews.llvm.org/D94921
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// UNSUPPORTED: libcpp-has-no-filesystem-library
|
|
|
|
// <experimental/filesystem>
|
|
|
|
// #define __cpp_lib_experimental_filesystem 201406L
|
|
|
|
#include <experimental/filesystem>
|
|
#include "test_macros.h"
|
|
|
|
#if TEST_STD_VER >= 11
|
|
#ifndef __cpp_lib_experimental_filesystem
|
|
#error Filesystem feature test macro is not defined (__cpp_lib_experimental_filesystem)
|
|
#elif __cpp_lib_experimental_filesystem != 201406L
|
|
#error Filesystem feature test macro has an incorrect value (__cpp_lib_experimental_filesystem)
|
|
#endif
|
|
#else // TEST_STD_VER < 11
|
|
#ifdef __cpp_lib_experimental_filesystem
|
|
#error Filesystem feature test macro should not be defined in c++03
|
|
#endif
|
|
#endif
|
|
|
|
int main(int, char**) {
|
|
return 0;
|
|
}
|