Skip to content

Commit 96e5657

Browse files
committed
[NFC] [Modules] Add a test for issue 81745
Although the root cause of #81745 shows not related to modules, it should be good to add a regression test for that.
1 parent f6ac598 commit 96e5657

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

clang/test/Modules/pr81745.cppm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: rm -rf %t
2+
// RUN: mkdir -p %t
3+
// RUN: split-file %s %t
4+
//
5+
// RUN: %clang_cc1 -std=c++20 %t/M.cppm -triple=x86_64-linux-gnu \
6+
// RUN: -emit-module-interface -o %t/M.pcm
7+
// RUN: %clang_cc1 -std=c++20 %t/foo.cpp -fprebuilt-module-path=%t \
8+
// RUN: -triple=x86_64-linux-gnu -emit-llvm -o - | FileCheck %t/foo.cpp
9+
10+
//--- M.cppm
11+
export module M;
12+
export struct S1 {
13+
consteval S1(int) {}
14+
};
15+
16+
//--- foo.cpp
17+
import M;
18+
void foo() {
19+
struct S2 { S1 s = 0; };
20+
S2 s;
21+
}
22+
23+
// CHECK-NOT: _ZNW1M2S1C1Ei

0 commit comments

Comments
 (0)