| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: mkdir -p %t |
| 3 |
// RUN: split-file %s %t |
| 4 |
// |
| 5 |
// RUN: %clang_cc1 -std=c++23 %t/a.cppm -emit-module-interface -o %t/a.pcm |
| 6 |
// RUN: %clang_cc1 -std=c++23 %t/b.cppm -emit-module-interface -o %t/b.pcm \ |
| 7 |
// RUN: -fprebuilt-module-path=%t |
| 8 |
// RUN: %clang_cc1 -std=c++23 -fprebuilt-module-path=%t %t/b.pcm -emit-llvm \ |
| 9 |
// RUN: -disable-llvm-passes -o - | FileCheck %t/b.cppm |
| 10 |
|
| 11 |
//--- a.cppm |
| 12 |
module; |
| 13 |
|
| 14 |
struct base { |
| 15 |
virtual void f() const; |
| 16 |
}; |
| 17 |
|
| 18 |
inline void base::f() const { |
| 19 |
} |
| 20 |
|
| 21 |
export module a; |
| 22 |
export using ::base; |
| 23 |
|
| 24 |
//--- b.cppm |
| 25 |
module; |
| 26 |
|
| 27 |
struct base { |
| 28 |
virtual void f() const; |
| 29 |
}; |
| 30 |
|
| 31 |
inline void base::f() const { |
| 32 |
} |
| 33 |
|
| 34 |
export module b; |
| 35 |
import a; |
| 36 |
export using ::base; |
| 37 |
|
| 38 |
export extern "C" void func() {} |
| 39 |
|
| 40 |
// We only need to check that the IR are successfully emitted instead of crash. |
| 41 |
// CHECK: func |