| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: mkdir -p %t |
| 3 |
// RUN: split-file %s %t |
| 4 |
|
| 5 |
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-3-ex1-tu1.cpp \ |
| 6 |
// RUN: -o %t/M_PartImpl.pcm |
| 7 |
|
| 8 |
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-3-ex1-tu2.cpp \ |
| 9 |
// RUN: -fmodule-file=M:PartImpl=%t/M_PartImpl.pcm -o %t/M.pcm -verify |
| 10 |
|
| 11 |
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-3-ex1-tu3.cpp \ |
| 12 |
// RUN: -o %t/M_Part.pcm |
| 13 |
|
| 14 |
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/std10-3-ex1-tu4.cpp \ |
| 15 |
// RUN: -fmodule-file=M:Part=%t/M_Part.pcm -o %t/M.pcm |
| 16 |
|
| 17 |
// Test again with reduced BMI. |
| 18 |
// RUN: rm %t/M_PartImpl.pcm %t/M.pcm %t/M_Part.pcm |
| 19 |
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu1.cpp \ |
| 20 |
// RUN: -o %t/M_PartImpl.pcm |
| 21 |
|
| 22 |
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu2.cpp \ |
| 23 |
// RUN: -fmodule-file=M:PartImpl=%t/M_PartImpl.pcm -o %t/M.pcm -verify |
| 24 |
|
| 25 |
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu3.cpp \ |
| 26 |
// RUN: -o %t/M_Part.pcm |
| 27 |
|
| 28 |
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/std10-3-ex1-tu4.cpp \ |
| 29 |
// RUN: -fmodule-file=M:Part=%t/M_Part.pcm -o %t/M.pcm |
| 30 |
|
| 31 |
//--- std10-3-ex1-tu1.cpp |
| 32 |
module M:PartImpl; |
| 33 |
|
| 34 |
// expected-no-diagnostics |
| 35 |
|
| 36 |
//--- std10-3-ex1-tu2.cpp |
| 37 |
export module M; |
| 38 |
// error: exported partition :Part is an implementation unit |
| 39 |
export import :PartImpl; // expected-error {{module partition implementations cannot be exported}} |
| 40 |
// expected-warning@-1 {{importing an implementation partition unit in a module interface is not recommended.}} |
| 41 |
|
| 42 |
//--- std10-3-ex1-tu3.cpp |
| 43 |
export module M:Part; |
| 44 |
|
| 45 |
// expected-no-diagnostics |
| 46 |
|
| 47 |
//--- std10-3-ex1-tu4.cpp |
| 48 |
export module M; |
| 49 |
export import :Part; |
| 50 |
|
| 51 |
// expected-no-diagnostics |