Debian Codegraph @

clang/test/Modules/pr120277.cppm

raw
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/a.cppm -emit-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \
7 // RUN: -fprebuilt-module-path=%t
8 // RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \
9 // RUN: -fprebuilt-module-path=%t
10 // RUN: %clang_cc1 -std=c++20 %t/d.cppm -emit-module-interface -o %t/d.pcm \
11 // RUN: -fprebuilt-module-path=%t
12 // RUN: %clang_cc1 -std=c++20 %t/d.pcm -emit-llvm -o %t/d.ll \
13 // RUN: -fprebuilt-module-path=%t
14 // RUN: cat %t/d.ll | FileCheck %t/d.cppm
15
16 //--- a.cppm
17 export module a;
18
19 export template<int>
20 struct a {
21 static auto f() {
22 }
23 };
24
25 //--- b.cppm
26 export module b;
27
28 import a;
29
30 void b() {
31 a<0> t;
32 }
33
34 //--- c.cppm
35 export module c;
36
37 import a;
38
39 void c() {
40 a<0>::f();
41 }
42
43 //--- d.cppm
44 export module d;
45
46 import a;
47 import b;
48 import c;
49
50 struct d {
51 static void g() {
52 a<0>::f();
53 a<1>::f();
54 }
55 };
56
57 // fine enough to check it won't crash
58 // CHECK: define