| 1 |
// RUN: rm -fr %t |
| 2 |
// RUN: mkdir %t |
| 3 |
// RUN: split-file %s %t |
| 4 |
// |
| 5 |
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/m-a.pcm |
| 6 |
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/m-b.pcm \ |
| 7 |
// RUN: -fprebuilt-module-path=%t |
| 8 |
// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-module-interface -o %t/m.pcm \ |
| 9 |
// RUN: -fprebuilt-module-path=%t |
| 10 |
// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -emit-obj |
| 11 |
|
| 12 |
// Test again with reduced BMI. |
| 13 |
// RUN: rm -fr %t |
| 14 |
// RUN: mkdir %t |
| 15 |
// RUN: split-file %s %t |
| 16 |
// |
| 17 |
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/m-a.pcm |
| 18 |
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/m-b.pcm \ |
| 19 |
// RUN: -fprebuilt-module-path=%t |
| 20 |
// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-reduced-module-interface -o %t/m.pcm \ |
| 21 |
// RUN: -fprebuilt-module-path=%t |
| 22 |
// RUN: %clang_cc1 -std=c++20 %t/use.cppm -fprebuilt-module-path=%t -emit-obj |
| 23 |
|
| 24 |
|
| 25 |
//--- a.cppm |
| 26 |
export module m:a; |
| 27 |
namespace n { |
| 28 |
export class a { |
| 29 |
public: |
| 30 |
virtual ~a() {} |
| 31 |
}; |
| 32 |
} |
| 33 |
|
| 34 |
//--- b.cppm |
| 35 |
export module m:b; |
| 36 |
namespace n { |
| 37 |
class a; |
| 38 |
} |
| 39 |
|
| 40 |
//--- m.cppm |
| 41 |
export module m; |
| 42 |
export import :a; |
| 43 |
export import :b; |
| 44 |
|
| 45 |
//--- use.cppm |
| 46 |
// expected-no-diagnostics |
| 47 |
export module u; |
| 48 |
export import m; |
| 49 |
|
| 50 |
struct aa : public n::a { |
| 51 |
aa() {} |
| 52 |
}; |
| 53 |
auto foo(n::a*) { |
| 54 |
return; |
| 55 |
} |
| 56 |
|
| 57 |
void use() { |
| 58 |
n::a _; |
| 59 |
} |