From 5c99c5fbee6f18596c98a634646b93844175976d Mon Sep 17 00:00:00 2001 From: cpplearner Date: Thu, 1 Jan 2026 20:22:12 +0800 Subject: [PATCH 1/9] Add Clang diagnostic pragmas in standard library modules --- stl/modules/std.compat.ixx | 12 ++++++++ stl/modules/std.ixx | 12 ++++++++ .../include/test_header_units_and_modules.hpp | 2 ++ .../custom_format.py | 17 +++++++++-- .../custombuild.pl | 17 +++++++++-- .../custom_format.py | 13 +++++++-- .../custombuild.pl | 11 +++++-- tests/std/tests/modules_20_matrix.lst | 29 ++++++++++++------- 8 files changed, 90 insertions(+), 23 deletions(-) diff --git a/stl/modules/std.compat.ixx b/stl/modules/std.compat.ixx index a44c4149419..174004cf713 100644 --- a/stl/modules/std.compat.ixx +++ b/stl/modules/std.compat.ixx @@ -1,6 +1,14 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +module; + +#ifdef __clang__ +#pragma clang diagnostic push +// warning: 'std' is a reserved name for a module [-Wreserved-module-identifier] +#pragma clang diagnostic ignored "-Wreserved-module-identifier" +#endif // defined(__clang__) + export module std.compat; export import std; @@ -531,3 +539,7 @@ export using std::towlower; export using std::towupper; export using std::towctrans; export using std::wctrans; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // defined(__clang__) diff --git a/stl/modules/std.ixx b/stl/modules/std.ixx index d582fc80db7..90566244d64 100644 --- a/stl/modules/std.ixx +++ b/stl/modules/std.ixx @@ -34,6 +34,15 @@ module; // defines some types outside of `extern "C"` or `extern "C++"`. #include +#ifdef __clang__ +#pragma clang diagnostic push +// warning: '#include ' attaches the declarations to the named module 'std', which is not usually intended; +// consider moving that directive before the module declaration [-Winclude-angled-in-module-purview] +// warning: 'std' is a reserved name for a module [-Wreserved-module-identifier] +#pragma clang diagnostic ignored "-Winclude-angled-in-module-purview" +#pragma clang diagnostic ignored "-Wreserved-module-identifier" +#endif // defined(__clang__) + export module std; #pragma warning(push) @@ -155,3 +164,6 @@ export module std; #include #pragma warning(pop) +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // defined(__clang__) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index df85f9439e5..fc0f8368f6a 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -755,7 +755,9 @@ constexpr bool impl_test_source_location() { using namespace std; const auto sl = source_location::current(); assert(sl.line() == __LINE__ - 1); +#ifndef __clang__ assert(sl.column() == 38); +#endif // !defined(__clang__) #ifdef __EDG__ assert(sl.function_name() == "bool impl_test_source_location()"sv); diff --git a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py index d7d6a69fe11..f716d65e041 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py +++ b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py @@ -21,10 +21,21 @@ def getBuildSteps(self, test, litConfig, shared): test4Cpp = os.path.join(sourceDir, 'test4.cpp') classicCpp = os.path.join(sourceDir, 'classic.cpp') - # Dependency order is important here: - inputPaths = [stdIxx, stdCompatIxx, testCpp, test2Cpp, test3Cpp, test4Cpp, classicCpp] + moduleUnits = [stdIxx, stdCompatIxx] + traditionalUnits = [testCpp, test2Cpp, test3Cpp, test4Cpp, classicCpp] - cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] + if 'clang' in test.cxx: + for modulePath in moduleUnits: + cmd = [test.cxx, '-x', 'c++-module', modulePath, '--precompile', *test.flags, *test.compileFlags] + yield TestStep(cmd, shared.execDir, shared.env, False) + + inputPaths = ['-x', 'c++-module', *moduleUnits, '-x', 'none', *traditionalUnits] + cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] + else: + # Dependency order is important here: + inputPaths = [*moduleUnits, *traditionalUnits] + + cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] if TestType.COMPILE in test.testType: cmd += ['/c'] diff --git a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl index caece9c6b68..740d61b5221 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl +++ b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl @@ -15,9 +15,20 @@ () my $stdIxx = "$stlModulesDir\\std.ixx"; my $stdCompatIxx = "$stlModulesDir\\std.compat.ixx"; - # Dependency order is important here: - my @inputPaths = ($stdIxx, $stdCompatIxx, "test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); + my @moduleUnits = ($stdIxx, $stdCompatIxx); + my @traditionalUnits = ("test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); - Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); + if ($ENV{PM_COMPILER} =~ m/clang/) { + for my $modulePath (@moduleUnits) { + Run::ExecuteCL("-x c++-module $modulePath --precompile"); + } + + Run::ExecuteCL(join(" ", "-x", "c++-module", @moduleUnits, "-x", "none", @traditionalUnits, "/Fe$cwd.exe")); + } else { + # Dependency order is important here: + my @inputPaths = ($stdIxx, $stdCompatIxx, "test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); + + Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); + } } 1 diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py b/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py index 4432e6ba306..e4f45b0181d 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py @@ -15,10 +15,17 @@ def getBuildSteps(self, test, litConfig, shared): sourceDir = os.path.dirname(testCpp) userIxx = os.path.join(sourceDir, 'user.ixx') - # Dependency order is important here: - inputPaths = [userIxx, testCpp] + if 'clang' in test.cxx: + cmd = [test.cxx, '-x', 'c++-module', userIxx, '--precompile', *test.flags, *test.compileFlags] + yield TestStep(cmd, shared.execDir, shared.env, False) - cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] + inputPaths = ['-x', 'c++-module', userIxx, '-x', 'none', testCpp] + cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] + else: + # Dependency order is important here: + inputPaths = [userIxx, testCpp] + + cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] if TestType.COMPILE in test.testType: cmd += ['/c'] diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl index cd5b08f5d5a..2461a3f7e7d 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl @@ -10,9 +10,14 @@ () { my $cwd = Run::GetCWDName(); - # Dependency order is important here: - my @inputPaths = ("user.ixx", "test.cpp"); + if ($ENV{PM_COMPILER} =~ m/clang/) { + Run::ExecuteCL("-x c++-module user.ixx --precompile"); + Run::ExecuteCL("-x c++-module user.ixx -x none test.cpp /Fe$cwd.exe"); + } else { + # Dependency order is important here: + my @inputPaths = ("user.ixx", "test.cpp"); - Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); + Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); + } } 1 diff --git a/tests/std/tests/modules_20_matrix.lst b/tests/std/tests/modules_20_matrix.lst index 6ccb872fd81..eb8a0f816e0 100644 --- a/tests/std/tests/modules_20_matrix.lst +++ b/tests/std/tests/modules_20_matrix.lst @@ -3,18 +3,25 @@ RUNALL_INCLUDE ..\..\universal_prefix.lst RUNALL_CROSSLIST -* PM_CL="/w14365 /D_ENFORCE_FACET_SPECIALIZATIONS=1 /Zc:preprocessor" +* PM_CL="/w14365 /D_ENFORCE_FACET_SPECIALIZATIONS=1" RUNALL_CROSSLIST * PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /DTEST_STANDARD=20 /std:c++20" * PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /DTEST_STANDARD=23 /std:c++latest" RUNALL_CROSSLIST -* PM_CL="/MD" -* PM_CL="/MDd" -* PM_CL="/MT" -* PM_CL="/MTd" -* PM_CL="/MDd /analyze:only /analyze:autolog-" -* PM_CL="/MDd /GR- /D_HAS_STATIC_RTTI=0" -* PM_CL="/MDd /utf-8" -RUNALL_CROSSLIST -PM_CL="" -ASAN PM_CL="-fsanitize=address /Zi" PM_LINK="/debug" +PM_CL="/MD /Zc:preprocessor" +ASAN PM_CL="/MD /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" +PM_CL="/MDd /Zc:preprocessor" +ASAN PM_CL="/MDd /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" +PM_CL="/MT /Zc:preprocessor" +ASAN PM_CL="/MT /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" +PM_CL="/MTd /Zc:preprocessor" +ASAN PM_CL="/MTd /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" +PM_CL="/MDd /analyze:only /analyze:autolog- /Zc:preprocessor" +ASAN PM_CL="/MDd /analyze:only /analyze:autolog- /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" +PM_CL="/MDd /GR- /D_HAS_STATIC_RTTI=0 /Zc:preprocessor" +ASAN PM_CL="/MDd /GR- /D_HAS_STATIC_RTTI=0 /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" +PM_CL="/MDd /utf-8 /Zc:preprocessor" +ASAN PM_CL="/MDd /utf-8 /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" +PM_COMPILER="clang-cl" PM_CL="-fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MD" +PM_COMPILER="clang-cl" PM_CL="-fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MTd" +PM_COMPILER="clang-cl" PM_CL="-fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MT" From c56c79209e52c16e67a77993729a46a0f9136d07 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Fri, 2 Jan 2026 11:44:35 +0800 Subject: [PATCH 2/9] Workaround LLVM-37969 --- stl/modules/std.ixx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stl/modules/std.ixx b/stl/modules/std.ixx index 90566244d64..b64780ad4f6 100644 --- a/stl/modules/std.ixx +++ b/stl/modules/std.ixx @@ -35,6 +35,8 @@ module; #include #ifdef __clang__ +#include // TRANSITION, LLVM-37969 + #pragma clang diagnostic push // warning: '#include ' attaches the declarations to the named module 'std', which is not usually intended; // consider moving that directive before the module declaration [-Winclude-angled-in-module-purview] From f4d12c2b4ad4f013398efbcf222470c4fae72cb8 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Fri, 2 Jan 2026 18:57:47 +0800 Subject: [PATCH 3/9] Workaround LLVM-158341 --- tests/std/include/test_header_units_and_modules.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index fc0f8368f6a..79d7275b5ea 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -284,6 +284,7 @@ void test_future() { assert(f.get() == 1729); } +#if !(defined(__clang__) && defined(_M_ARM64EC)) // TRANSITION, LLVM-158341 #if TEST_STANDARD >= 23 void test_generator() { using namespace std; @@ -297,6 +298,7 @@ void test_generator() { assert(ranges::equal(some_ints(bound), views::iota(0, bound))); } #endif // TEST_STANDARD >= 23 +#endif // ^^^ no workaround ^^^ void test_initializer_list() { using namespace std; @@ -1200,9 +1202,11 @@ void all_cpp_header_tests() { test_fstream(); test_functional(); test_future(); +#if !(defined(__clang__) && defined(_M_ARM64EC)) // TRANSITION, LLVM-158341 #if TEST_STANDARD >= 23 test_generator(); #endif // TEST_STANDARD >= 23 +#endif // ^^^ no workaround ^^^ test_initializer_list(); test_iomanip(); test_ios(); From 5bd397b08f386c129c3d00fcfd4b7349584234ec Mon Sep 17 00:00:00 2001 From: cpplearner Date: Sun, 18 Jan 2026 19:28:18 +0800 Subject: [PATCH 4/9] Rework Clang detection --- .../std/tests/P2465R3_standard_library_modules/custom_format.py | 2 +- tests/std/tests/P2465R3_standard_library_modules/custombuild.pl | 2 +- .../std/tests/VSO_1775715_user_defined_modules/custom_format.py | 2 +- tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py index f716d65e041..6372d796737 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py +++ b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py @@ -24,7 +24,7 @@ def getBuildSteps(self, test, litConfig, shared): moduleUnits = [stdIxx, stdCompatIxx] traditionalUnits = [testCpp, test2Cpp, test3Cpp, test4Cpp, classicCpp] - if 'clang' in test.cxx: + if 'clang' in test.config.available_features: for modulePath in moduleUnits: cmd = [test.cxx, '-x', 'c++-module', modulePath, '--precompile', *test.flags, *test.compileFlags] yield TestStep(cmd, shared.execDir, shared.env, False) diff --git a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl index 740d61b5221..726c680665d 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl +++ b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl @@ -18,7 +18,7 @@ () my @moduleUnits = ($stdIxx, $stdCompatIxx); my @traditionalUnits = ("test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); - if ($ENV{PM_COMPILER} =~ m/clang/) { + if ($ENV{PM_COMPILER} eq "clang-cl") { for my $modulePath (@moduleUnits) { Run::ExecuteCL("-x c++-module $modulePath --precompile"); } diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py b/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py index e4f45b0181d..4145142c7d0 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py @@ -15,7 +15,7 @@ def getBuildSteps(self, test, litConfig, shared): sourceDir = os.path.dirname(testCpp) userIxx = os.path.join(sourceDir, 'user.ixx') - if 'clang' in test.cxx: + if 'clang' in test.config.available_features: cmd = [test.cxx, '-x', 'c++-module', userIxx, '--precompile', *test.flags, *test.compileFlags] yield TestStep(cmd, shared.execDir, shared.env, False) diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl index 2461a3f7e7d..ad27fc387f7 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl @@ -10,7 +10,7 @@ () { my $cwd = Run::GetCWDName(); - if ($ENV{PM_COMPILER} =~ m/clang/) { + if ($ENV{PM_COMPILER} eq "clang-cl") { Run::ExecuteCL("-x c++-module user.ixx --precompile"); Run::ExecuteCL("-x c++-module user.ixx -x none test.cpp /Fe$cwd.exe"); } else { From 25211f9451ed17be760ecd9df49b056adafc6f70 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Thu, 14 May 2026 20:13:17 +0800 Subject: [PATCH 5/9] Add workaround for Clang 22 `-WTU-local-entity-exposure` --- stl/inc/complex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stl/inc/complex b/stl/inc/complex index 29f64e559af..eddc23a48be 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -21,7 +21,8 @@ // https://learn.microsoft.com/cpp/build/arm64-windows-abi-conventions#base-requirements // Both floating-point and NEON support are presumed to be present in hardware. #define _FMP_USING_STD_FMA -#elif defined(_M_IX86) || defined(_M_X64) +#elif (defined(_M_IX86) || defined(_M_X64)) \ + && !(defined(_BUILD_STD_MODULE) && defined(__clang__)) // TRANSITION, LLVM-195661 #define _FMP_USING_X86_X64_INTRINSICS #include <__msvc_bit_utils.hpp> #include From bbc568e206ccaea0aa49275933b15ac32d8e7ad5 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Thu, 14 May 2026 20:16:22 +0800 Subject: [PATCH 6/9] Use `-fmodule-output` --- .../custom_format.py | 10 ++-------- .../custombuild.pl | 16 ++++++---------- .../custom_format.py | 8 ++------ .../custombuild.pl | 12 ++++++------ tests/std/tests/modules_20_matrix.lst | 6 +++--- 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py index 6372d796737..1cca3ff6358 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py +++ b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py @@ -21,21 +21,15 @@ def getBuildSteps(self, test, litConfig, shared): test4Cpp = os.path.join(sourceDir, 'test4.cpp') classicCpp = os.path.join(sourceDir, 'classic.cpp') + # Dependency order is important here: moduleUnits = [stdIxx, stdCompatIxx] traditionalUnits = [testCpp, test2Cpp, test3Cpp, test4Cpp, classicCpp] - if 'clang' in test.config.available_features: - for modulePath in moduleUnits: - cmd = [test.cxx, '-x', 'c++-module', modulePath, '--precompile', *test.flags, *test.compileFlags] - yield TestStep(cmd, shared.execDir, shared.env, False) - inputPaths = ['-x', 'c++-module', *moduleUnits, '-x', 'none', *traditionalUnits] - cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] else: - # Dependency order is important here: inputPaths = [*moduleUnits, *traditionalUnits] - cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] + cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] if TestType.COMPILE in test.testType: cmd += ['/c'] diff --git a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl index 726c680665d..186d27bb13b 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl +++ b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl @@ -15,20 +15,16 @@ () my $stdIxx = "$stlModulesDir\\std.ixx"; my $stdCompatIxx = "$stlModulesDir\\std.compat.ixx"; + # Dependency order is important here: my @moduleUnits = ($stdIxx, $stdCompatIxx); my @traditionalUnits = ("test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); - + my @inputPaths; if ($ENV{PM_COMPILER} eq "clang-cl") { - for my $modulePath (@moduleUnits) { - Run::ExecuteCL("-x c++-module $modulePath --precompile"); - } - - Run::ExecuteCL(join(" ", "-x", "c++-module", @moduleUnits, "-x", "none", @traditionalUnits, "/Fe$cwd.exe")); + @inputPaths = ("-x", "c++-module", @moduleUnits, "-x", "none", @traditionalUnits); } else { - # Dependency order is important here: - my @inputPaths = ($stdIxx, $stdCompatIxx, "test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); - - Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); + @inputPaths = (@moduleUnits, @traditionalUnits); } + + Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); } 1 diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py b/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py index 4145142c7d0..45f08071785 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custom_format.py @@ -15,17 +15,13 @@ def getBuildSteps(self, test, litConfig, shared): sourceDir = os.path.dirname(testCpp) userIxx = os.path.join(sourceDir, 'user.ixx') + # Dependency order is important here: if 'clang' in test.config.available_features: - cmd = [test.cxx, '-x', 'c++-module', userIxx, '--precompile', *test.flags, *test.compileFlags] - yield TestStep(cmd, shared.execDir, shared.env, False) - inputPaths = ['-x', 'c++-module', userIxx, '-x', 'none', testCpp] - cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] else: - # Dependency order is important here: inputPaths = [userIxx, testCpp] - cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] + cmd = [test.cxx, *inputPaths, *test.flags, *test.compileFlags] if TestType.COMPILE in test.testType: cmd += ['/c'] diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl index ad27fc387f7..24097392545 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl @@ -10,14 +10,14 @@ () { my $cwd = Run::GetCWDName(); + # Dependency order is important here: + my @inputPaths; if ($ENV{PM_COMPILER} eq "clang-cl") { - Run::ExecuteCL("-x c++-module user.ixx --precompile"); - Run::ExecuteCL("-x c++-module user.ixx -x none test.cpp /Fe$cwd.exe"); + @inputPaths = ("-x", "c++-module", "user.ixx", "-x", "none", "test.cpp"); } else { - # Dependency order is important here: - my @inputPaths = ("user.ixx", "test.cpp"); - - Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); + @inputPaths = ("user.ixx", "test.cpp"); } + + Run::ExecuteCL(join(" ", @inputPaths, "/Fe$cwd.exe")); } 1 diff --git a/tests/std/tests/modules_20_matrix.lst b/tests/std/tests/modules_20_matrix.lst index eb8a0f816e0..7a2d5d5316a 100644 --- a/tests/std/tests/modules_20_matrix.lst +++ b/tests/std/tests/modules_20_matrix.lst @@ -22,6 +22,6 @@ PM_CL="/MDd /GR- /D_HAS_STATIC_RTTI=0 /Zc:preprocessor" ASAN PM_CL="/MDd /GR- /D_HAS_STATIC_RTTI=0 /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" PM_CL="/MDd /utf-8 /Zc:preprocessor" ASAN PM_CL="/MDd /utf-8 /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug" -PM_COMPILER="clang-cl" PM_CL="-fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MD" -PM_COMPILER="clang-cl" PM_CL="-fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MTd" -PM_COMPILER="clang-cl" PM_CL="-fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MT" +PM_COMPILER="clang-cl" PM_CL="-fmodule-output -fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MD" +PM_COMPILER="clang-cl" PM_CL="-fmodule-output -fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MTd" +PM_COMPILER="clang-cl" PM_CL="-fmodule-output -fprebuilt-module-path=. -Wno-unqualified-std-cast-call /MT" From e44086bd7e6cd870d9d030471f81356312d04c05 Mon Sep 17 00:00:00 2001 From: cpplearner Date: Thu, 28 May 2026 11:33:20 +0800 Subject: [PATCH 7/9] Remove workaround for LLVM-158341 --- tests/std/include/test_header_units_and_modules.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index 01baba4088e..f91f1b40112 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -334,7 +334,6 @@ void test_future() { assert(f.get() == 1729); } -#if !(defined(__clang__) && defined(_M_ARM64EC)) // TRANSITION, LLVM-158341 #if TEST_STANDARD >= 23 void test_generator() { using namespace std; @@ -348,7 +347,6 @@ void test_generator() { assert(ranges::equal(some_ints(bound), views::iota(0, bound))); } #endif // TEST_STANDARD >= 23 -#endif // ^^^ no workaround ^^^ void test_initializer_list() { using namespace std; @@ -1256,11 +1254,9 @@ void all_cpp_header_tests() { test_fstream(); test_functional(); test_future(); -#if !(defined(__clang__) && defined(_M_ARM64EC)) // TRANSITION, LLVM-158341 #if TEST_STANDARD >= 23 test_generator(); #endif // TEST_STANDARD >= 23 -#endif // ^^^ no workaround ^^^ test_initializer_list(); test_iomanip(); test_ios(); From 1f96b51c8f94e92895679dee79526c19005564f6 Mon Sep 17 00:00:00 2001 From: "S. B. Tam" Date: Fri, 12 Jun 2026 15:59:04 +0800 Subject: [PATCH 8/9] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- tests/std/tests/P2465R3_standard_library_modules/custombuild.pl | 2 +- tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl index 186d27bb13b..8d78c646f02 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl +++ b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl @@ -19,7 +19,7 @@ () my @moduleUnits = ($stdIxx, $stdCompatIxx); my @traditionalUnits = ("test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); my @inputPaths; - if ($ENV{PM_COMPILER} eq "clang-cl") { + if (($ENV{PM_COMPILER} // "") eq "clang-cl") { @inputPaths = ("-x", "c++-module", @moduleUnits, "-x", "none", @traditionalUnits); } else { @inputPaths = (@moduleUnits, @traditionalUnits); diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl index 24097392545..2ebf3ea2bb6 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl @@ -12,7 +12,7 @@ () # Dependency order is important here: my @inputPaths; - if ($ENV{PM_COMPILER} eq "clang-cl") { + if (($ENV{PM_COMPILER} // "") eq "clang-cl") { @inputPaths = ("-x", "c++-module", "user.ixx", "-x", "none", "test.cpp"); } else { @inputPaths = ("user.ixx", "test.cpp"); From 44539c491eebeb92e4c62468dd4aadc63ed451ef Mon Sep 17 00:00:00 2001 From: cpplearner Date: Fri, 12 Jun 2026 21:15:27 +0800 Subject: [PATCH 9/9] Fix --- tests/std/tests/P2465R3_standard_library_modules/custombuild.pl | 2 +- tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl index 8d78c646f02..91a42c8e5cc 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl +++ b/tests/std/tests/P2465R3_standard_library_modules/custombuild.pl @@ -19,7 +19,7 @@ () my @moduleUnits = ($stdIxx, $stdCompatIxx); my @traditionalUnits = ("test.cpp", "test2.cpp", "test3.cpp", "test4.cpp", "classic.cpp"); my @inputPaths; - if (($ENV{PM_COMPILER} // "") eq "clang-cl") { + if (($ENV{PM_COMPILER} // "") eq "clang-cl") { @inputPaths = ("-x", "c++-module", @moduleUnits, "-x", "none", @traditionalUnits); } else { @inputPaths = (@moduleUnits, @traditionalUnits); diff --git a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl index 2ebf3ea2bb6..95adb3ba0ac 100644 --- a/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl +++ b/tests/std/tests/VSO_1775715_user_defined_modules/custombuild.pl @@ -12,7 +12,7 @@ () # Dependency order is important here: my @inputPaths; - if (($ENV{PM_COMPILER} // "") eq "clang-cl") { + if (($ENV{PM_COMPILER} // "") eq "clang-cl") { @inputPaths = ("-x", "c++-module", "user.ixx", "-x", "none", "test.cpp"); } else { @inputPaths = ("user.ixx", "test.cpp");