Skip to content

Commit 905ee44

Browse files
committed
[NFC] [C++20] [Modules] Test that we can avoid adding more specializations in reduced BMI
1 parent 175e3be commit 905ee44

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+
// RUN: rm -rf %t
2+
// RUN: split-file %s %t
3+
//
4+
// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-module-interface -o %t/base.pcm
5+
// RUN: %clang_cc1 -std=c++20 %t/update.cppm -fmodule-file=base=%t/base.pcm -emit-module-interface -o %t/update.pcm
6+
// RUN: llvm-bcanalyzer --dump --disable-histogram %t/update.pcm | FileCheck %t/update.cppm --check-prefix=FULL
7+
//
8+
// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-reduced-module-interface -o %t/base.pcm
9+
// RUN: %clang_cc1 -std=c++20 %t/update.cppm -fmodule-file=base=%t/base.pcm -emit-reduced-module-interface -o %t/update.pcm
10+
// RUN: llvm-bcanalyzer --dump --disable-histogram %t/update.pcm | FileCheck %t/update.cppm
11+
12+
//--- base.cppm
13+
export module base;
14+
15+
export template <typename T>
16+
struct base {
17+
T value;
18+
};
19+
20+
//--- update.cppm
21+
export module update;
22+
import base;
23+
export int update() {
24+
return base<int>().value;
25+
}
26+
27+
// FULL: TEMPLATE_SPECIALIZATION
28+
// CHECK-NOT: TEMPLATE_SPECIALIZATION

0 commit comments

Comments
 (0)