| 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/module1.cppm -emit-module-interface -o %t/module1.pcm |
| 6 |
// RUN: %clang_cc1 -std=c++20 -fmodule-file=module1=%t/module1.pcm %t/module2.cppm \ |
| 7 |
// RUN: -emit-module-interface -o %t/module2.pcm |
| 8 |
// RUN: %clang_cc1 -std=c++20 %t/module2.pcm -fmodule-file=module1=%t/module1.pcm \ |
| 9 |
// RUN: -emit-llvm -o - | FileCheck %t/module2.cppm |
| 10 |
|
| 11 |
//--- test.h |
| 12 |
template<typename T> |
| 13 |
struct Test { |
| 14 |
template<typename U> |
| 15 |
friend class Test; |
| 16 |
}; |
| 17 |
|
| 18 |
//--- module1.cppm |
| 19 |
module; |
| 20 |
#include "test.h" |
| 21 |
export module module1; |
| 22 |
export void f1(Test<int>) {} |
| 23 |
|
| 24 |
//--- module2.cppm |
| 25 |
module; |
| 26 |
#include "test.h" |
| 27 |
export module module2; |
| 28 |
import module1; |
| 29 |
export void f2(Test<float>) {} |
| 30 |
|
| 31 |
extern "C" void func() {} |
| 32 |
|
| 33 |
// Fine enough to check the IR is emitted correctly. |
| 34 |
// CHECK: define{{.*}}@func |