| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: split-file %s %t |
| 3 |
// RUN: cd %t |
| 4 |
// |
| 5 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/a.cppm \ |
| 6 |
// RUN: -emit-module-interface -o %t/a.pcm |
| 7 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.cppm \ |
| 8 |
// RUN: -emit-module-interface -fmodule-file=a=%t/a.pcm -o %t/m.pcm |
| 9 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.pcm \ |
| 10 |
// RUN: -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/m.cppm |
| 11 |
|
| 12 |
// Test again with reduced BMI. |
| 13 |
// Note that we can't use reduced BMI here for m.cppm since it is required |
| 14 |
// to generate the backend code. |
| 15 |
// RUN: rm %t/a.pcm %t/m.pcm |
| 16 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/a.cppm \ |
| 17 |
// RUN: -emit-reduced-module-interface -o %t/a.pcm |
| 18 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.cppm \ |
| 19 |
// RUN: -emit-module-interface -fmodule-file=a=%t/a.pcm -o %t/m.pcm |
| 20 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.pcm \ |
| 21 |
// RUN: -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/m.cppm |
| 22 |
|
| 23 |
//--- a.cppm |
| 24 |
export module a; |
| 25 |
export struct A { |
| 26 |
A(){}; |
| 27 |
}; |
| 28 |
export A __dynamic_inited_a; |
| 29 |
|
| 30 |
//--- m.cppm |
| 31 |
export module m; |
| 32 |
import a; |
| 33 |
export import a; |
| 34 |
|
| 35 |
|
| 36 |
// CHECK: define void @_ZGIW1m |
| 37 |
// CHECK: store i8 1, ptr @_ZGIW1m__in_chrg |
| 38 |
// CHECK: call{{.*}}@_ZGIW1a |