[libcxx-commits] [libcxx] 8d53f11 - [libc++] Enable additional tests when Clang modules are enabled (#168967)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 22 07:06:08 PST 2026


Author: Louis Dionne
Date: 2026-02-22T08:06:03-07:00
New Revision: 8d53f11955057a5ffd1482978631128fa8ae7e74

URL: https://github.com/llvm/llvm-project/commit/8d53f11955057a5ffd1482978631128fa8ae7e74
DIFF: https://github.com/llvm/llvm-project/commit/8d53f11955057a5ffd1482978631128fa8ae7e74.diff

LOG: [libc++] Enable additional tests when Clang modules are enabled (#168967)

Disabling tests when Clang modules are enabled is not great because we
are moving more and more tests towards using Clang modules by default.
Instead, disable Clang modules on a per-test basis.

Added: 
    

Modified: 
    libcxx/test/extensions/libcxx/depr/depr.c.headers/extern_c.pass.cpp
    libcxx/test/extensions/libcxx/depr/depr.c.headers/include_as_c.sh.cpp
    libcxx/test/extensions/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp
    libcxx/test/extensions/posix/xopen_source.gen.py
    libcxx/test/libcxx-03/assertions/customize_verbose_abort.compile-time.pass.cpp
    libcxx/test/libcxx-03/assertions/modes/hardening_mode_incorrect_value.sh.cpp
    libcxx/test/libcxx-03/transitive_includes.gen.py
    libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
    libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
    libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
    libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp
    libcxx/test/libcxx/assertions/modes/hardening_mode_incorrect_value.sh.cpp
    libcxx/test/libcxx/assertions/semantics/assertion_semantic_incorrect_value.sh.cpp
    libcxx/test/libcxx/depr/exception.unexpected/unexpected_disabled_cpp17.verify.cpp
    libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
    libcxx/test/libcxx/transitive_includes.gen.py
    libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
    libcxx/test/selftest/modules/std-and-std.compat-module.sh.cpp
    libcxx/test/selftest/modules/std-module.sh.cpp
    libcxx/test/selftest/modules/std.compat-module.sh.cpp
    libcxx/test/std/modules/std.compat.pass.cpp
    libcxx/test/std/modules/std.pass.cpp
    libcxx/utils/libcxx/test/config.py
    libcxx/utils/libcxx/test/dsl.py
    libcxx/utils/libcxx/test/format.py
    libcxx/utils/libcxx/test/modules.py

Removed: 
    


################################################################################
diff  --git a/libcxx/test/extensions/libcxx/depr/depr.c.headers/extern_c.pass.cpp b/libcxx/test/extensions/libcxx/depr/depr.c.headers/extern_c.pass.cpp
index 33b55c4bb195a..b7bdd841ea3e0 100644
--- a/libcxx/test/extensions/libcxx/depr/depr.c.headers/extern_c.pass.cpp
+++ b/libcxx/test/extensions/libcxx/depr/depr.c.headers/extern_c.pass.cpp
@@ -8,7 +8,7 @@
 
 // When building with modules, including headers inside extern "C" is an anti-pattern
 // that we don't want to support and can't support with LSV enabled.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // Sometimes C++'s <foo.h> headers get included within extern "C" contexts. This
 // is ill-formed (no diagnostic required), per [using.headers]p3, but we permit

diff  --git a/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_as_c.sh.cpp b/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_as_c.sh.cpp
index 635c7e3aa4f5f..dd9847f63253b 100644
--- a/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_as_c.sh.cpp
+++ b/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_as_c.sh.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // We're building as C, so this test doesn't work when building with modules.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // GCC complains about unrecognized arguments because we're compiling the
 // file as C, but we're passing C++ flags on the command-line.

diff  --git a/libcxx/test/extensions/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp b/libcxx/test/extensions/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp
index 75a4ab908ce21..f665ec5a1b5db 100644
--- a/libcxx/test/extensions/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp
+++ b/libcxx/test/extensions/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // This test breaks when enabling LSV.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // Test that limits macros are available when <stdint.h> is included
 // with or without macro _XOPEN_SOURCE=700.

diff  --git a/libcxx/test/extensions/posix/xopen_source.gen.py b/libcxx/test/extensions/posix/xopen_source.gen.py
index ec0d981d67b2b..e98197c8ed21c 100644
--- a/libcxx/test/extensions/posix/xopen_source.gen.py
+++ b/libcxx/test/extensions/posix/xopen_source.gen.py
@@ -12,11 +12,6 @@
 #
 # https://llvm.org/PR117630
 
-# Some parts of the code like <fstream> use non-standard functions in their implementation,
-# and these functions are not provided when _XOPEN_SOURCE is set to older values. This
-# breaks when building with modules even when we don't use the offending headers directly.
-# UNSUPPORTED: clang-modules-build
-
 # The AIX localization support uses some functions as part of their headers that require a
 # recent value of _XOPEN_SOURCE.
 # UNSUPPORTED: LIBCXX-AIX-FIXME
@@ -50,6 +45,11 @@
 
 // ADDITIONAL_COMPILE_FLAGS: -D_XOPEN_SOURCE={version}
 
+// Some parts of the code like <fstream> use non-standard functions in their implementation,
+// and these functions are not provided when _XOPEN_SOURCE is set to older values. This
+// breaks when building with modules even when we don't use the offending headers directly.
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 #include <{header}>
 """
         )

diff  --git a/libcxx/test/libcxx-03/assertions/customize_verbose_abort.compile-time.pass.cpp b/libcxx/test/libcxx-03/assertions/customize_verbose_abort.compile-time.pass.cpp
index 69154c3f7eaff..bb44bc68eb1ce 100644
--- a/libcxx/test/libcxx-03/assertions/customize_verbose_abort.compile-time.pass.cpp
+++ b/libcxx/test/libcxx-03/assertions/customize_verbose_abort.compile-time.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // This compile-time customization requires cross-file macros, which doesn't work with modules.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // Make sure that we can customize the verbose termination function at compile-time by
 // defining _LIBCPP_VERBOSE_ABORT ourselves. Note that this does not have any

diff  --git a/libcxx/test/libcxx-03/assertions/modes/hardening_mode_incorrect_value.sh.cpp b/libcxx/test/libcxx-03/assertions/modes/hardening_mode_incorrect_value.sh.cpp
index 751ff7247445f..4f0abd8ab9d07 100644
--- a/libcxx/test/libcxx-03/assertions/modes/hardening_mode_incorrect_value.sh.cpp
+++ b/libcxx/test/libcxx-03/assertions/modes/hardening_mode_incorrect_value.sh.cpp
@@ -9,10 +9,11 @@
 // This test verifies that setting the hardening mode to a value that's not part of the predefined constants triggers
 // a compile-time error.
 
-// Modules build produces a 
diff erent error ("Could not build module 'std'").
-// UNSUPPORTED: clang-modules-build
 // REQUIRES: verify-support
 
+// TODO: Investigate
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // Note that GCC doesn't support `-Wno-macro-redefined`.
 // RUN: %{verify} -U_LIBCPP_HARDENING_MODE -D_LIBCPP_HARDENING_MODE=42
 // Make sure that common cases of misuse produce readable errors. We deliberately disallow setting the hardening mode as

diff  --git a/libcxx/test/libcxx-03/transitive_includes.gen.py b/libcxx/test/libcxx-03/transitive_includes.gen.py
index 6f99240436632..3ab9986bdb94c 100644
--- a/libcxx/test/libcxx-03/transitive_includes.gen.py
+++ b/libcxx/test/libcxx-03/transitive_includes.gen.py
@@ -77,7 +77,7 @@
 
 // When built with modules, this test doesn't work because --trace-includes doesn't
 // report the stack of includes correctly.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // This test uses --trace-includes, which is not supported by GCC.
 // UNSUPPORTED: gcc

diff  --git a/libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp b/libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
index d961884398920..a544019586902 100644
--- a/libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
+++ b/libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
@@ -8,7 +8,7 @@
 
 // The test suite needs to define the ABI macros on the command line when
 // modules are enabled.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // <utility>
 

diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
index 162a3539d2308..f0da45d9bd281 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp
@@ -7,11 +7,13 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// In the modules build, adding another overload of `memmove` doesn't work.
-// UNSUPPORTED: clang-modules-build
+
 // GCC complains about "ambiguating" `__builtin_memmove`.
 // UNSUPPORTED: gcc
 
+// In the modules build, adding another overload of `memmove` doesn't work.
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // <algorithm>
 
 #include <cassert>

diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
index ff10c7919200d..e009438acb005 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp
@@ -7,11 +7,13 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// In the modules build, adding another overload of `memmove` doesn't work.
-// UNSUPPORTED: clang-modules-build
+
 // GCC complains about "ambiguating" `__builtin_memmove`.
 // UNSUPPORTED: gcc
 
+// In the modules build, adding another overload of `memmove` doesn't work.
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // <algorithm>
 
 // These tests check that `std::copy` and `std::move` (including their variations like `copy_n`) forward to

diff  --git a/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp b/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp
index 69154c3f7eaff..bb44bc68eb1ce 100644
--- a/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp
+++ b/libcxx/test/libcxx/assertions/customize_verbose_abort.compile-time.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // This compile-time customization requires cross-file macros, which doesn't work with modules.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // Make sure that we can customize the verbose termination function at compile-time by
 // defining _LIBCPP_VERBOSE_ABORT ourselves. Note that this does not have any

diff  --git a/libcxx/test/libcxx/assertions/modes/hardening_mode_incorrect_value.sh.cpp b/libcxx/test/libcxx/assertions/modes/hardening_mode_incorrect_value.sh.cpp
index 751ff7247445f..4f0abd8ab9d07 100644
--- a/libcxx/test/libcxx/assertions/modes/hardening_mode_incorrect_value.sh.cpp
+++ b/libcxx/test/libcxx/assertions/modes/hardening_mode_incorrect_value.sh.cpp
@@ -9,10 +9,11 @@
 // This test verifies that setting the hardening mode to a value that's not part of the predefined constants triggers
 // a compile-time error.
 
-// Modules build produces a 
diff erent error ("Could not build module 'std'").
-// UNSUPPORTED: clang-modules-build
 // REQUIRES: verify-support
 
+// TODO: Investigate
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // Note that GCC doesn't support `-Wno-macro-redefined`.
 // RUN: %{verify} -U_LIBCPP_HARDENING_MODE -D_LIBCPP_HARDENING_MODE=42
 // Make sure that common cases of misuse produce readable errors. We deliberately disallow setting the hardening mode as

diff  --git a/libcxx/test/libcxx/assertions/semantics/assertion_semantic_incorrect_value.sh.cpp b/libcxx/test/libcxx/assertions/semantics/assertion_semantic_incorrect_value.sh.cpp
index d7c1e26491ba9..67a0ed5aaa408 100644
--- a/libcxx/test/libcxx/assertions/semantics/assertion_semantic_incorrect_value.sh.cpp
+++ b/libcxx/test/libcxx/assertions/semantics/assertion_semantic_incorrect_value.sh.cpp
@@ -9,11 +9,12 @@
 // This test verifies that setting the assertion semantic to a value that's not part of the predefined constants
 // triggers a compile-time error.
 
-// Modules build produces a 
diff erent error ("Could not build module 'std'").
-// UNSUPPORTED: clang-modules-build
 // UNSUPPORTED: c++03, libcpp-has-no-experimental-hardening-observe-semantic
 // REQUIRES: verify-support
 
+// TODO: Investigate
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // RUN: %{verify} -U_LIBCPP_ASSERTION_SEMANTIC -D_LIBCPP_ASSERTION_SEMANTIC=42
 // `hardening-dependent` cannot be set as the semantic (it's only an indicator to use hardening-related logic to pick
 // the final semantic).

diff  --git a/libcxx/test/libcxx/depr/exception.unexpected/unexpected_disabled_cpp17.verify.cpp b/libcxx/test/libcxx/depr/exception.unexpected/unexpected_disabled_cpp17.verify.cpp
index b92f2baa02e47..10939ab91c69b 100644
--- a/libcxx/test/libcxx/depr/exception.unexpected/unexpected_disabled_cpp17.verify.cpp
+++ b/libcxx/test/libcxx/depr/exception.unexpected/unexpected_disabled_cpp17.verify.cpp
@@ -11,7 +11,7 @@
 // When built with modules, this test gives diagnostics like declaration of
 // 'unexpected' must be imported from module 'std.expected.unexpected' before
 // it is required. Therefore disable it in this configuration.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // test unexpected
 

diff  --git a/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp b/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
index 134978d099ecf..7eafb77c2de9c 100644
--- a/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
+++ b/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // This test breaks when enabling LSV.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // UNSUPPORTED: c++03, c++11, c++14
 

diff  --git a/libcxx/test/libcxx/transitive_includes.gen.py b/libcxx/test/libcxx/transitive_includes.gen.py
index 2b643e1f2ad48..8995482778d43 100644
--- a/libcxx/test/libcxx/transitive_includes.gen.py
+++ b/libcxx/test/libcxx/transitive_includes.gen.py
@@ -75,7 +75,7 @@
 
 // When built with modules, this test doesn't work because --trace-includes doesn't
 // report the stack of includes correctly.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // This test uses --trace-includes, which is not supported by GCC.
 // UNSUPPORTED: gcc

diff  --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
index 1f5dae1232e37..65ae7de663162 100644
--- a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp
@@ -8,7 +8,7 @@
 
 // The test suite needs to define the ABI macros on the command line when
 // modules are enabled.
-// UNSUPPORTED: clang-modules-build
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
 
 // <utility>
 

diff  --git a/libcxx/test/selftest/modules/std-and-std.compat-module.sh.cpp b/libcxx/test/selftest/modules/std-and-std.compat-module.sh.cpp
index 455674d6b9949..32e4c06f750c5 100644
--- a/libcxx/test/selftest/modules/std-and-std.compat-module.sh.cpp
+++ b/libcxx/test/selftest/modules/std-and-std.compat-module.sh.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: clang-modules-build
 // UNSUPPORTED: gcc
 
 // TODO: This test is currently written in a way that is specific to libc++, but it's really trying to test a property
@@ -16,6 +15,12 @@
 
 // XFAIL: has-no-cxx-module-support
 
+// Apple Clang 17 advertises C++ Modules support but fails to compile this test.
+// XFAIL: apple-clang-17
+
+// C++20 modules are incompatible with Clang modules
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // Make sure that the compile flags contain the expected elements.
 // The tests only look for the expected components and not the exact flags.
 // Otherwise changing the location of the module would break this test.

diff  --git a/libcxx/test/selftest/modules/std-module.sh.cpp b/libcxx/test/selftest/modules/std-module.sh.cpp
index e96c1e64b7275..8304d5f429190 100644
--- a/libcxx/test/selftest/modules/std-module.sh.cpp
+++ b/libcxx/test/selftest/modules/std-module.sh.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: clang-modules-build
 // UNSUPPORTED: gcc
 
 // TODO: This test is currently written in a way that is specific to libc++, but it's really trying to test a property
@@ -16,6 +15,12 @@
 
 // XFAIL: has-no-cxx-module-support
 
+// Apple Clang 17 advertises C++ Modules support but fails to compile this test.
+// XFAIL: apple-clang-17
+
+// C++20 modules are incompatible with Clang modules
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // Make sure that the compile flags contain the expected elements.
 // The tests only look for the expected components and not the exact flags.
 // Otherwise changing the location of the module would break this test.

diff  --git a/libcxx/test/selftest/modules/std.compat-module.sh.cpp b/libcxx/test/selftest/modules/std.compat-module.sh.cpp
index 4ec0ad8323d8d..cdfd1a187fbff 100644
--- a/libcxx/test/selftest/modules/std.compat-module.sh.cpp
+++ b/libcxx/test/selftest/modules/std.compat-module.sh.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: clang-modules-build
 // UNSUPPORTED: gcc
 
 // TODO: This test is currently written in a way that is specific to libc++, but it's really trying to test a property
@@ -16,6 +15,12 @@
 
 // XFAIL: has-no-cxx-module-support
 
+// Apple Clang 17 advertises C++ Modules support but fails to compile this test.
+// XFAIL: apple-clang-17
+
+// C++20 modules are incompatible with Clang modules
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // Make sure that the compile flags contain the expected elements.
 // The tests only look for the expected components and not the exact flags.
 // Otherwise changing the location of the module would break this test.

diff  --git a/libcxx/test/std/modules/std.compat.pass.cpp b/libcxx/test/std/modules/std.compat.pass.cpp
index e840f3c6b629c..a99f34b4ed19f 100644
--- a/libcxx/test/std/modules/std.compat.pass.cpp
+++ b/libcxx/test/std/modules/std.compat.pass.cpp
@@ -7,13 +7,18 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: clang-modules-build
 // UNSUPPORTED: gcc
 
 // XFAIL: has-no-cxx-module-support
 
+// Apple Clang 17 advertises C++ Modules support but fails to compile this test.
+// XFAIL: apple-clang-17
+
 // A minimal test to validate import works.
 
+// C++20 modules are incompatible with Clang modules
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // MODULE_DEPENDENCIES: std.compat
 
 import std.compat;

diff  --git a/libcxx/test/std/modules/std.pass.cpp b/libcxx/test/std/modules/std.pass.cpp
index ca05825b3a186..325a2fdebe1bc 100644
--- a/libcxx/test/std/modules/std.pass.cpp
+++ b/libcxx/test/std/modules/std.pass.cpp
@@ -7,13 +7,18 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// UNSUPPORTED: clang-modules-build
 // UNSUPPORTED: gcc
 
 // XFAIL: has-no-cxx-module-support
 
+// Apple Clang 17 advertises C++ Modules support but fails to compile this test.
+// XFAIL: apple-clang-17
+
 // A minimal test to validate import works.
 
+// C++20 modules are incompatible with Clang modules
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // MODULE_DEPENDENCIES: std
 
 import std;

diff  --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 00fab6a73ba68..c1bba1167d9a3 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -9,8 +9,8 @@
 import os
 
 
-def _getSubstitution(substitution, config):
-    for (orig, replacement) in config.substitutions:
+def _getSubstitution(substitution, all_substitutions):
+    for (orig, replacement) in all_substitutions:
         if orig == substitution:
             return replacement
     raise ValueError("Substitution {} is not in the config.".format(substitution))
@@ -52,7 +52,7 @@ def configure(parameters, features, config, lit_config):
 
     # Print the basic substitutions
     for sub in ("%{cxx}", "%{flags}", "%{compile_flags}", "%{link_flags}", "%{benchmark_flags}", "%{exec}"):
-        note("Using {} substitution: '{}'".format(sub, _getSubstitution(sub, config)))
+        note("Using {} substitution: '{}'".format(sub, _getSubstitution(sub, config.substitutions)))
 
     # Print all available features
     note("All available features: {}".format(", ".join(sorted(config.available_features))))

diff  --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py
index 88fc49160c56b..710b1b69d21da 100644
--- a/libcxx/utils/libcxx/test/dsl.py
+++ b/libcxx/utils/libcxx/test/dsl.py
@@ -365,8 +365,8 @@ def featureTestMacros(config, flags=""):
     }
 
 
-def _getSubstitution(substitution, config):
-  for (orig, replacement) in config.substitutions:
+def _getSubstitution(substitution, all_substitutions):
+  for (orig, replacement) in all_substitutions:
     if orig == substitution:
       return replacement
   raise ValueError('Substitution {} is not in the config.'.format(substitution))

diff  --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 76e9115295b99..a0c8b6e31cebe 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -167,7 +167,7 @@ def parseScript(test, preamble):
         # The moduleCompileFlags are added to the %{compile_flags}, but
         # the modules need to be built without these flags. So expand the
         # %{compile_flags} eagerly and hardcode them in the build script.
-        compileFlags = config._getSubstitution("%{compile_flags}", test.config)
+        compileFlags = config._getSubstitution("%{compile_flags}", substitutions)
 
         # Building the modules needs to happen before the other script
         # commands are executed. Therefore the commands are added to the

diff  --git a/libcxx/utils/libcxx/test/modules.py b/libcxx/utils/libcxx/test/modules.py
index b93846bf1788e..4076379c41276 100644
--- a/libcxx/utils/libcxx/test/modules.py
+++ b/libcxx/utils/libcxx/test/modules.py
@@ -118,13 +118,19 @@ def write_lit_configuration(self):
         print(
             f"""\
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: clang-modules-build
+
+// These tests check that we provide all declarations, so they currently don't work when
+// carve-outs are enabled.
+// XFAIL: no-filesystem, no-tzdb, no-localization, no-threads, no-wide-characters
 
 // REQUIRES: has-clang-tidy
 
 // The GCC compiler flags are not always compatible with clang-tidy.
 // UNSUPPORTED: gcc
 
+// C++20 modules are incompatible with Clang modules
+// ADDITIONAL_COMPILE_FLAGS: -fno-modules
+
 // MODULE_DEPENDENCIES: {self.module}
 
 // RUN: echo -n > {self.tmp_prefix}.all_partitions


        


More information about the libcxx-commits mailing list