[libc++][C++20 modules] Tests no experimental library build.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158936
This commit is contained in:
Mark de Wever 2023-08-26 18:00:19 +02:00
parent f2f36c9b29
commit d015e481d7
8 changed files with 16 additions and 6 deletions

View File

@ -1,2 +1,3 @@
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
set(LIBCXX_TEST_PARAMS "enable_experimental=False" CACHE STRING "")
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

View File

@ -71,7 +71,6 @@ Some of the current limitations
* Only C++23 and C++26 are tested
* Libc++ is not tested with modules instead of headers
* The module ``.cppm`` files are not installed
* The experimental ``PSTL`` library is not supported
* Clang supports modules using GNU extensions, but libc++ does not work using
GNU extensions.
* Clang:

View File

@ -35,7 +35,6 @@ target_sources(std
std.cppm
)
target_compile_definitions(std PRIVATE _LIBCPP_ENABLE_EXPERIMENTAL)
target_include_directories(std SYSTEM PRIVATE @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
if (NOT @LIBCXX_ENABLE_EXCEPTIONS@)

View File

@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
#ifdef _LIBCPP_ENABLE_EXPERIMENTAL
export namespace std {
// [execpol.type], execution policy type trait
using std::is_execution_policy;
@ -32,3 +33,4 @@ export namespace std::execution {
using std::execution::seq;
using std::execution::unseq;
} // namespace std::execution
#endif // _LIBCPP_ENABLE_EXPERIMENTAL

View File

@ -204,11 +204,13 @@ export namespace std {
using std::ranges::views::drop_while;
} // namespace views
#ifdef _LIBCPP_ENABLE_EXPERIMENTAL
using std::ranges::join_view;
namespace views {
using std::ranges::views::join;
} // namespace views
#endif // _LIBCPP_ENABLE_EXPERIMENTAL
#if 0
using std::ranges::join_with_view;

View File

@ -9,6 +9,7 @@
export namespace std {
#ifndef _LIBCPP_HAS_NO_THREADS
# ifdef _LIBCPP_ENABLE_EXPERIMENTAL
// [stoptoken], class stop_­token
using std::stop_token;
@ -21,5 +22,6 @@ export namespace std {
// [stopcallback], class template stop_­callback
using std::stop_callback;
#endif // _LIBCPP_HAS_NO_THREADS
# endif // _LIBCPP_ENABLE_EXPERIMENTAL
#endif // _LIBCPP_HAS_NO_THREADS
} // namespace std

View File

@ -52,8 +52,10 @@ if (
+ os.path.join(config.test_exec_root, "__config_module__/CMakeFiles/std.dir"),
)
flags = getSubstitution("%{flags}", config)
cmake = getSubstitution("%{cmake}", config)
flags = getSubstitution("%{flags}", config)
if "c++experimental" in config.available_features:
flags = f"{flags} -D_LIBCPP_ENABLE_EXPERIMENTAL"
subprocess.check_call(
[cmake, f"-DCMAKE_CXX_STANDARD={std}", f"-DCMAKE_CXX_FLAGS={flags}", build],

View File

@ -687,8 +687,11 @@ steps:
- "**/test-results.xml"
- "**/*.abilist"
env:
CC: "clang-${LLVM_HEAD_VERSION}"
CXX: "clang++-${LLVM_HEAD_VERSION}"
# Note: Modules require and absolute path for clang-scan-deps
# https://github.com/llvm/llvm-project/issues/61006
CC: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang"
CXX: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang++"
CMAKE: "/opt/bin/cmake"
ENABLE_CLANG_TIDY: "On"
agents:
queue: "libcxx-builders"