252
|
1 // From https://github.com/llvm/llvm-project/issues/61067
|
|
2 // RUN: rm -rf %t
|
|
3 // RUN: mkdir -p %t
|
|
4 // RUN: split-file %s %t
|
|
5 //
|
|
6 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/a.cppm \
|
|
7 // RUN: -emit-module-interface -o %t/a.pcm
|
|
8 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cppm \
|
|
9 // RUN: -emit-module-interface -fmodule-file=a=%t/a.pcm -o %t/b.pcm
|
|
10 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.pcm -S \
|
|
11 // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %t/b.cppm
|
|
12 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/c.cpp -fmodule-file=a=%t/a.pcm \
|
|
13 // RUN: -S -emit-llvm -disable-llvm-passes -o - | FileCheck %t/c.cpp
|
|
14
|
|
15 //--- a.cppm
|
|
16 export module a;
|
|
17
|
|
18 export struct a {
|
|
19 friend bool operator==(a, a) = default;
|
|
20 };
|
|
21
|
|
22 //--- b.cppm
|
|
23 export module b;
|
|
24
|
|
25 import a;
|
|
26
|
|
27 void b() {
|
|
28 (void)(a() == a());
|
|
29 }
|
|
30
|
|
31 // CHECK: define{{.*}}linkonce_odr{{.*}}@_ZW1aeqS_1aS0_(
|
|
32
|
|
33 //--- c.cpp
|
|
34 import a;
|
|
35
|
|
36 int c() {
|
|
37 (void)(a() == a());
|
|
38 }
|
|
39
|
|
40 // CHECK: define{{.*}}linkonce_odr{{.*}}@_ZW1aeqS_1aS0_(
|