xref: /llvm-project/clang/test/Modules/pr62705.cppm (revision da00c60dae0040185dc45039c4397f6e746548e9)
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
22namespace n {
23
24template<typename>
25struct s0 {
26	static int m;
27};
28
29template<typename T>
30struct s1 {
31	using type = s0<T>;
32};
33
34}
35
36template<typename T>
37void require(n::s1<T>) {
38}
39
40//--- a.cppm
41module;
42
43#include "foo.h"
44
45export module a;
46
47//--- b.cppm
48module;
49
50#include "foo.h"
51
52export module b;
53import a;
54
55// Check the LLVM IR of module 'b' get generated correctly.
56// CHECK: define{{.*}}@_ZGIW1b
57