Skip to content

Commit d015e48

Browse files
committed
[libc++][C++20 modules] Tests no experimental library build.
Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D158936
1 parent f2f36c9 commit d015e48

File tree

8 files changed

+16
-6
lines changed

8 files changed

+16
-6
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
12
set(LIBCXX_TEST_PARAMS "enable_experimental=False" CACHE STRING "")
23
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

libcxx/docs/Modules.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Some of the current limitations
7171
* Only C++23 and C++26 are tested
7272
* Libc++ is not tested with modules instead of headers
7373
* The module ``.cppm`` files are not installed
74-
* The experimental ``PSTL`` library is not supported
7574
* Clang supports modules using GNU extensions, but libc++ does not work using
7675
GNU extensions.
7776
* Clang:

libcxx/modules/CMakeLists.txt.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ target_sources(std
3535
std.cppm
3636
)
3737

38-
target_compile_definitions(std PRIVATE _LIBCPP_ENABLE_EXPERIMENTAL)
3938
target_include_directories(std SYSTEM PRIVATE @LIBCXX_CONFIGURED_INCLUDE_DIRS@)
4039

4140
if (NOT @LIBCXX_ENABLE_EXCEPTIONS@)

libcxx/modules/std/execution.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10+
#ifdef _LIBCPP_ENABLE_EXPERIMENTAL
1011
export namespace std {
1112
// [execpol.type], execution policy type trait
1213
using std::is_execution_policy;
@@ -32,3 +33,4 @@ export namespace std::execution {
3233
using std::execution::seq;
3334
using std::execution::unseq;
3435
} // namespace std::execution
36+
#endif // _LIBCPP_ENABLE_EXPERIMENTAL

libcxx/modules/std/ranges.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,13 @@ export namespace std {
204204
using std::ranges::views::drop_while;
205205
} // namespace views
206206

207+
#ifdef _LIBCPP_ENABLE_EXPERIMENTAL
207208
using std::ranges::join_view;
208209

209210
namespace views {
210211
using std::ranges::views::join;
211212
} // namespace views
213+
#endif // _LIBCPP_ENABLE_EXPERIMENTAL
212214
#if 0
213215
using std::ranges::join_with_view;
214216

libcxx/modules/std/stop_token.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
export namespace std {
1111
#ifndef _LIBCPP_HAS_NO_THREADS
12+
# ifdef _LIBCPP_ENABLE_EXPERIMENTAL
1213
// [stoptoken], class stop_­token
1314
using std::stop_token;
1415

@@ -21,5 +22,6 @@ export namespace std {
2122

2223
// [stopcallback], class template stop_­callback
2324
using std::stop_callback;
24-
#endif // _LIBCPP_HAS_NO_THREADS
25+
# endif // _LIBCPP_ENABLE_EXPERIMENTAL
26+
#endif // _LIBCPP_HAS_NO_THREADS
2527
} // namespace std

libcxx/test/lit.local.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ if (
5252
+ os.path.join(config.test_exec_root, "__config_module__/CMakeFiles/std.dir"),
5353
)
5454

55-
flags = getSubstitution("%{flags}", config)
5655
cmake = getSubstitution("%{cmake}", config)
56+
flags = getSubstitution("%{flags}", config)
57+
if "c++experimental" in config.available_features:
58+
flags = f"{flags} -D_LIBCPP_ENABLE_EXPERIMENTAL"
5759

5860
subprocess.check_call(
5961
[cmake, f"-DCMAKE_CXX_STANDARD={std}", f"-DCMAKE_CXX_FLAGS={flags}", build],

libcxx/utils/ci/buildkite-pipeline.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,11 @@ steps:
687687
- "**/test-results.xml"
688688
- "**/*.abilist"
689689
env:
690-
CC: "clang-${LLVM_HEAD_VERSION}"
691-
CXX: "clang++-${LLVM_HEAD_VERSION}"
690+
# Note: Modules require and absolute path for clang-scan-deps
691+
# https://github.com/llvm/llvm-project/issues/61006
692+
CC: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang"
693+
CXX: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang++"
694+
CMAKE: "/opt/bin/cmake"
692695
ENABLE_CLANG_TIDY: "On"
693696
agents:
694697
queue: "libcxx-builders"

0 commit comments

Comments
 (0)