Debian Codegraph @

clang/test/Modules/no-transitive-decl-change-4.cppm

raw
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/T.cppm -o %t/T.pcm \
7 // RUN: -fmodule-file=T=%t/T.pcm
8 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/T1.cppm -o %t/T1.pcm \
9 // RUN: -fmodule-file=T=%t/T.pcm
10 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/T2.cppm -o %t/T2.pcm \
11 // RUN: -fmodule-file=T=%t/T.pcm
12 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/T3.cppm -o %t/T3.pcm \
13 // RUN: -fmodule-file=T=%t/T.pcm
14 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/T4.cppm -o %t/T4.pcm \
15 // RUN: -fmodule-file=T=%t/T.pcm
16 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.cppm -o %t/A.pcm \
17 // RUN: -fmodule-file=T=%t/T.pcm
18 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/AWrapper.cppm -o %t/AWrapper.pcm \
19 // RUN: -fprebuilt-module-path=%t
20 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.pcm \
21 // RUN: -fprebuilt-module-path=%t
22 //
23 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.v1.cppm -o %t/A.v1.pcm \
24 // RUN: -fmodule-file=T=%t/T.pcm
25 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/AWrapper.cppm -o %t/AWrapper.v1.pcm \
26 // RUN: -fprebuilt-module-path=%t -fmodule-file=A=%t/A.v1.pcm
27 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.v1.pcm \
28 // RUN: -fprebuilt-module-path=%t -fmodule-file=AWrapper=%t/AWrapper.v1.pcm -fmodule-file=A=%t/A.v1.pcm
29 //
30 // RUN: not diff %t/B.pcm %t/B.v1.pcm &> /dev/null
31
32 //--- T.cppm
33 export module T;
34 export template <class T>
35 struct Templ {};
36
37 //--- T1.cppm
38 export module T1;
39 import T;
40 export using Tunsigned = Templ<unsigned>;
41
42 //--- T2.cppm
43 export module T2;
44 import T;
45 export using Tfloat = Templ<float>;
46
47 //--- T3.cppm
48 export module T3;
49 import T;
50 export using Tlong = Templ<long long>;
51
52 //--- T4.cppm
53 export module T4;
54 import T;
55 export using Tshort = Templ<short>;
56
57 //--- A.cppm
58 export module A;
59 import T;
60 export using Tint = Templ<int>;
61
62 //--- A.v1.cppm
63 export module A;
64 import T;
65 export using Tint = Templ<int>;
66 void __unused__() {}
67
68 //--- AWrapper.cppm
69 export module AWrapper;
70 import A;
71
72 //--- B.cppm
73 export module B;
74 import AWrapper;
75 import T;
76 import T1;
77 import T2;
78 import T3;
79 import T4;
80
81 export using Tdouble = Templ<double>;