[libcxx-commits] [libcxx] 382b707 - [libc++] Add coverage for C++17 and Clang Modules with LSV (#131815)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 20 10:51:02 PDT 2025
Author: Louis Dionne
Date: 2025-03-20T13:50:59-04:00
New Revision: 382b707e52ee6a0ca9a799795362dee67ade993f
URL: https://github.com/llvm/llvm-project/commit/382b707e52ee6a0ca9a799795362dee67ade993f
DIFF: https://github.com/llvm/llvm-project/commit/382b707e52ee6a0ca9a799795362dee67ade993f.diff
LOG: [libc++] Add coverage for C++17 and Clang Modules with LSV (#131815)
In recent versions of Clang, using -std=c++20 (and later) implies LSV
when compiling with modules. This change resulted in making our LSV job
redundant with the regular modules job, which uses the latest Standard.
This patch increases the coverage of our CI without increasing its cost
by pinning the LSV job to use C++17, which normally doesn't use LSV. A
related question is whether we should add coverage for non-LSV builds
using Clang modules.
Added:
libcxx/cmake/caches/Generic-modules-cxx17-lsv.cmake
Modified:
.github/workflows/libcxx-build-and-test.yaml
libcxx/test/libcxx/atomics/atomics.syn/incompatible_with_stdatomic.verify.cpp
libcxx/utils/ci/run-buildbot
libcxx/utils/libcxx/test/params.py
Removed:
libcxx/cmake/caches/Generic-modules-lsv.cmake
################################################################################
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index bd0d492f63cd9..bb7243a19cf70 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -137,7 +137,7 @@ jobs:
'generic-hardening-mode-fast',
'generic-hardening-mode-fast-with-abi-breaks',
'generic-merged',
- 'generic-modules-lsv',
+ 'generic-modules-cxx17-lsv',
'generic-no-exceptions',
'generic-no-experimental',
'generic-no-filesystem',
diff --git a/libcxx/cmake/caches/Generic-modules-cxx17-lsv.cmake b/libcxx/cmake/caches/Generic-modules-cxx17-lsv.cmake
new file mode 100644
index 0000000000000..c73e2a142092b
--- /dev/null
+++ b/libcxx/cmake/caches/Generic-modules-cxx17-lsv.cmake
@@ -0,0 +1,2 @@
+set(LIBCXX_TEST_PARAMS "enable_modules=clang-lsv;std=c++17" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git a/libcxx/cmake/caches/Generic-modules-lsv.cmake b/libcxx/cmake/caches/Generic-modules-lsv.cmake
deleted file mode 100644
index 395fccc217650..0000000000000
--- a/libcxx/cmake/caches/Generic-modules-lsv.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-set(LIBCXX_TEST_PARAMS "enable_modules=clang-lsv" CACHE STRING "")
-set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
diff --git a/libcxx/test/libcxx/atomics/atomics.syn/incompatible_with_stdatomic.verify.cpp b/libcxx/test/libcxx/atomics/atomics.syn/incompatible_with_stdatomic.verify.cpp
index ca092d9c60275..a788ea32dddc8 100644
--- a/libcxx/test/libcxx/atomics/atomics.syn/incompatible_with_stdatomic.verify.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.syn/incompatible_with_stdatomic.verify.cpp
@@ -9,6 +9,9 @@
// UNSUPPORTED: no-threads
// REQUIRES: c++03 || c++11 || c++14 || c++17 || c++20
+// No diagnostic gets emitted when we build with modules.
+// XFAIL: clang-modules-build
+
// This test ensures that we issue a reasonable diagnostic when including <atomic> after
// <stdatomic.h> has been included. Before C++23, this otherwise leads to obscure errors
// because <atomic> may try to redefine things defined by <stdatomic.h>.
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 947932f3802a1..29eebd1f92189 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -454,9 +454,9 @@ generic-modules)
check-runtimes
check-abi-list
;;
-generic-modules-lsv)
+generic-modules-cxx17-lsv)
clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules-lsv.cmake"
+ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules-cxx17-lsv.cmake"
check-runtimes
check-abi-list
;;
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 93dc3a8be3f08..58ace0ba96e35 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -210,7 +210,8 @@ def getSuitableClangTidy(cfg):
choices=["none", "clang", "clang-lsv"],
type=str,
help="Whether to build the test suite with modules enabled. "
- "Select `clang` for Clang modules, and 'clang-lsv' for Clang modules with Local Submodule Visibility.",
+ "Select `clang` for Clang modules, and 'clang-lsv' for Clang modules with Local Submodule Visibility. "
+ "Note that in recent versions of Clang, using Clang modules with -std=c++20 and later implies LSV.",
default="none",
actions=lambda modules: filter(None, [
AddFeature("clang-modules-build") if modules in ("clang", "clang-lsv") else None,
More information about the libcxx-commits
mailing list