| 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 -fmodule-file=A=%t/A.pcm -fsyntax-only -verify |
| 7 |
|
| 8 |
// RUN: rm %t/A.pcm |
| 9 |
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm |
| 10 |
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fmodule-file=A=%t/A.pcm -fsyntax-only -verify |
| 11 |
|
| 12 |
//--- A.cppm |
| 13 |
export module A; |
| 14 |
|
| 15 |
//--- B.cppm |
| 16 |
import A; // expected-note {{add 'module;' to the start of the file to introduce a global module fragment}} |
| 17 |
export module B; // expected-error {{module declaration must occur at the start of the translation unit}} |