Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / module / dcl.dcl / dcl.module / dcl.module.export / p1.cppm
blob3ad371bfaea48d75ac97c8f6272a479dfd447eb6
1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: split-file %s %t
4 //
5 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/b.cppm -o %t/b.pcm
7 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/c.cppm -o %t/c.pcm
8 //
9 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -emit-module-interface %t/aggregate.internal.cppm -o %t/aggregate.internal.pcm
10 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -emit-module-interface %t/aggregate.cppm -o %t/aggregate.pcm
12 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/use.cpp -verify -DTEST
15 //--- a.cppm
16 export module a;
17 export class A{};
19 //--- b.cppm
20 export module b;
21 export class B{};
23 //--- c.cppm
24 export module c;
25 export class C{};
27 //--- aggregate.internal.cppm
28 export module aggregate.internal;
29 export import a;
30 export import b;
31 export import c;
33 //--- aggregate.cppm
34 // Export the above aggregate module.
35 // This is done to ensure that re-exports are transitive.
36 export module aggregate;
37 export import aggregate.internal;
40 //--- use.cpp
41 // expected-no-diagnostics
42 // For the actual test, just try using the classes from the exported modules
43 // and hope that they're accessible.
44 import aggregate;
45 A a;
46 B b;
47 C c;