1 // Testing that changing a declaration in an unused module file won't change
2 // the BMI of the current module file.
5 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -std=c++20 %t/m-partA.cppm -emit-reduced-module-interface -o %t/m-partA.pcm
8 // RUN: %clang_cc1 -std=c++20 %t/m-partA.v1.cppm -emit-reduced-module-interface -o \
9 // RUN: %t/m-partA.v1.pcm
10 // RUN: %clang_cc1 -std=c++20 %t/m-partB.cppm -emit-reduced-module-interface -o %t/m-partB.pcm
11 // RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-reduced-module-interface -o %t/m.pcm \
12 // RUN: -fmodule-file=m:partA=%t/m-partA.pcm -fmodule-file=m:partB=%t/m-partB.pcm
13 // RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-reduced-module-interface -o %t/m.v1.pcm \
14 // RUN: -fmodule-file=m:partA=%t/m-partA.v1.pcm -fmodule-file=m:partB=%t/m-partB.pcm
16 // RUN: %clang_cc1 -std=c++20 %t/useBOnly.cppm -emit-reduced-module-interface -o %t/useBOnly.pcm \
17 // RUN: -fmodule-file=m=%t/m.pcm -fmodule-file=m:partA=%t/m-partA.pcm \
18 // RUN: -fmodule-file=m:partB=%t/m-partB.pcm
19 // RUN: %clang_cc1 -std=c++20 %t/useBOnly.cppm -emit-reduced-module-interface -o %t/useBOnly.v1.pcm \
20 // RUN: -fmodule-file=m=%t/m.v1.pcm -fmodule-file=m:partA=%t/m-partA.v1.pcm \
21 // RUN: -fmodule-file=m:partB=%t/m-partB.pcm
22 // Since useBOnly only uses partB from module M, the change in partA shouldn't affect
24 // RUN: diff %t/useBOnly.pcm %t/useBOnly.v1.pcm &> /dev/null
27 export module m:partA;
30 inline int getAImpl() {
34 inline int getA2Impl() {
40 using A_Impl::getAImpl;
43 export inline int getA() {
48 export module m:partA;
51 inline int getAImpl() {
55 inline int getA2Impl() {
61 using A_Impl::getAImpl;
62 using A_Impl::getA2Impl;
69 // The consuming module which didn't use m:partA completely is expected to be
71 inline int getB(int) {
76 export module m:partB;
78 export inline int getB() {
88 export module useBOnly;
91 export inline int get() {
96 export module useAOnly;
99 export inline int get() {