| 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/a.cppm -emit-module-interface -o %t/a.pcm |
| 6 |
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \ |
| 7 |
// RUN: -fprebuilt-module-path=%t |
| 8 |
// RUN: %clang_cc1 -std=c++20 %t/test.cc -fsyntax-only -verify \ |
| 9 |
// RUN: -fprebuilt-module-path=%t |
| 10 |
|
| 11 |
//--- foo.h |
| 12 |
inline auto x = []{}; |
| 13 |
|
| 14 |
//--- a.cppm |
| 15 |
module; |
| 16 |
#include "foo.h" |
| 17 |
export module a; |
| 18 |
export using ::x; |
| 19 |
|
| 20 |
//--- b.cppm |
| 21 |
module; |
| 22 |
import a; |
| 23 |
#include "foo.h" |
| 24 |
export module b; |
| 25 |
export using ::x; |
| 26 |
|
| 27 |
//--- test.cc |
| 28 |
// expected-no-diagnostics |
| 29 |
import a; |
| 30 |
import b; |
| 31 |
void test() { |
| 32 |
x(); |
| 33 |
} |