[clang] 80f216d - [C++20] [Modules] Add a test
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 26 23:05:38 PDT 2025
Author: Chuanqi Xu
Date: 2025-03-27T14:04:41+08:00
New Revision: 80f216db530eda98a444bc1994c7d69a7107c3c6
URL: https://github.com/llvm/llvm-project/commit/80f216db530eda98a444bc1994c7d69a7107c3c6
DIFF: https://github.com/llvm/llvm-project/commit/80f216db530eda98a444bc1994c7d69a7107c3c6.diff
LOG: [C++20] [Modules] Add a test
A test from a regression in the downstream.
The test should be always good.
Added:
clang/test/Modules/no-transitive-decl-change-3.cppm
Modified:
Removed:
################################################################################
diff --git a/clang/test/Modules/no-transitive-decl-change-3.cppm b/clang/test/Modules/no-transitive-decl-change-3.cppm
new file mode 100644
index 0000000000000..756c403c21759
--- /dev/null
+++ b/clang/test/Modules/no-transitive-decl-change-3.cppm
@@ -0,0 +1,28 @@
+// Test that adding a new unused decl within reduced BMI may not produce a transitive change.
+//
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+//
+// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.cppm -o %t/A.pcm
+// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.pcm \
+// RUN: -fmodule-file=A=%t/A.pcm
+//
+// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.v1.cppm -o %t/A.v1.pcm
+// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.v1.pcm \
+// RUN: -fmodule-file=A=%t/A.v1.pcm
+//
+// RUN: not
diff %t/B.pcm %t/B.v1.pcm &> /dev/null
+
+//--- A.cppm
+export module A;
+export int a() { return 44; }
+
+//--- A.v1.cppm
+export module A;
+export int a() { return 44; }
+int a_impl() { return 48; }
+
+//--- B.cppm
+export module B;
+import A;
+export inline int b = a();
More information about the cfe-commits
mailing list