Debian Codegraph @

clang/test/Modules/pr62705.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: split-file %s %t
4 //
5 // RUN: %clang_cc1 %t/a.cppm -std=c++20 -triple %itanium_abi_triple \
6 // RUN: -emit-module-interface -o %t/a.pcm
7 // RUN: %clang_cc1 %t/b.cppm -std=c++20 -triple %itanium_abi_triple \
8 // RUN: -emit-module-interface -o %t/b.pcm \
9 // RUN: -fmodule-file=a=%t/a.pcm
10 // RUN: %clang_cc1 %t/b.pcm -std=c++20 -triple %itanium_abi_triple \
11 // RUN: -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/b.cppm
12
13 // RUN: %clang_cc1 %t/a.cppm -std=c++20 -triple %itanium_abi_triple \
14 // RUN: -emit-reduced-module-interface -o %t/a.pcm
15 // RUN: %clang_cc1 %t/b.cppm -std=c++20 -triple %itanium_abi_triple \
16 // RUN: -emit-module-interface -o %t/b.pcm \
17 // RUN: -fmodule-file=a=%t/a.pcm
18 // RUN: %clang_cc1 %t/b.pcm -std=c++20 -triple %itanium_abi_triple \
19 // RUN: -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/b.cppm
20
21 //--- foo.h
22 namespace n {
23
24 template<typename>
25 struct s0 {
26 static int m;
27 };
28
29 template<typename T>
30 struct s1 {
31 using type = s0<T>;
32 };
33
34 }
35
36 template<typename T>
37 void require(n::s1<T>) {
38 }
39
40 //--- a.cppm
41 module;
42
43 #include "foo.h"
44
45 export module a;
46
47 //--- b.cppm
48 module;
49
50 #include "foo.h"
51
52 export module b;
53 import a;
54
55 // Check the LLVM IR of module 'b' get generated correctly.
56 // CHECK: define{{.*}}@_ZGIW1b