Skip to content

Commit 80f216d

Browse files
committed
[C++20] [Modules] Add a test
A test from a regression in the downstream. The test should be always good.
1 parent 68e90e4 commit 80f216d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Test that adding a new unused decl within reduced BMI may not produce a transitive change.
2+
//
3+
// RUN: rm -rf %t
4+
// RUN: split-file %s %t
5+
//
6+
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.cppm -o %t/A.pcm
7+
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.pcm \
8+
// RUN: -fmodule-file=A=%t/A.pcm
9+
//
10+
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.v1.cppm -o %t/A.v1.pcm
11+
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.v1.pcm \
12+
// RUN: -fmodule-file=A=%t/A.v1.pcm
13+
//
14+
// RUN: not diff %t/B.pcm %t/B.v1.pcm &> /dev/null
15+
16+
//--- A.cppm
17+
export module A;
18+
export int a() { return 44; }
19+
20+
//--- A.v1.cppm
21+
export module A;
22+
export int a() { return 44; }
23+
int a_impl() { return 48; }
24+
25+
//--- B.cppm
26+
export module B;
27+
import A;
28+
export inline int b = a();

0 commit comments

Comments
 (0)