| 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 -fprebuilt-module-path=%t -o %t/m.pcm |
| 9 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.pcm \ |
| 10 |
// RUN: -fprebuilt-module-path=%t -emit-llvm -o - | FileCheck %t/m.cppm |
| 11 |
|
| 12 |
// Test again with reduced BMI |
| 13 |
// |
| 14 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/a.cppm \ |
| 15 |
// RUN: -emit-reduced-module-interface -o %t/a.pcm |
| 16 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.cppm \ |
| 17 |
// RUN: -emit-reduced-module-interface -fprebuilt-module-path=%t -o %t/m.pcm |
| 18 |
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/m.pcm \ |
| 19 |
// RUN: -fprebuilt-module-path=%t -emit-llvm -o - | FileCheck %t/m.cppm |
| 20 |
|
| 21 |
//--- a.cppm |
| 22 |
export module a; |
| 23 |
export struct A { |
| 24 |
A(){}; |
| 25 |
}; |
| 26 |
export A __dynamic_inited_a; |
| 27 |
|
| 28 |
//--- m.cppm |
| 29 |
module; |
| 30 |
import a; |
| 31 |
export module m; |
| 32 |
import a; |
| 33 |
module :private; |
| 34 |
import a; |
| 35 |
|
| 36 |
// CHECK: define void @_ZGIW1m |
| 37 |
// CHECK: store i8 1, ptr @_ZGIW1m__in_chrg |
| 38 |
// CHECK: call{{.*}}@_ZGIW1a |