1 // Test output from -module-file-info about C++20 modules.
5 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/mod-info-tu1.cpp \
10 // RUN: %clang_cc1 -std=c++20 -module-file-info %t/A.pcm | FileCheck \
11 // RUN: --check-prefix=CHECK-A %s
13 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/mod-info-tu2.cpp \
16 // RUN: %clang_cc1 -std=c++20 -module-file-info %t/B.pcm | FileCheck \
17 // RUN: --check-prefix=CHECK-B %s
19 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/mod-info-tu3.cpp \
20 // RUN: -fmodule-file=A=%t/A.pcm -fmodule-file=B=%t/B.pcm -o %t/Foo.pcm
22 // RUN: %clang_cc1 -std=c++20 -module-file-info %t/Foo.pcm -fmodule-file=A=%t/A.pcm \
23 // RUN: -fmodule-file=B=%t/B.pcm | FileCheck \
24 // RUN: --check-prefix=CHECK-FOO %s
26 // expected-no-diagnostics
28 //--- mod-info-tu1.cpp
33 // CHECK-A: ====== C++20
34 // CHECK-A-NEXT: Interface Unit 'A' is the Primary Module at index #1
36 //--- mod-info-tu2.cpp
41 // CHECK-B: ====== C++20
42 // CHECK-B-NEXT: Interface Unit 'B' is the Primary Module at index #1
44 //--- mod-info-tu3.cpp
53 export
void say(const char *);
58 // CHECK-FOO: ====== C++20
59 // CHECK-FOO-NEXT: Interface Unit 'Foo' is the Primary Module at index #3
60 // CHECK-FOO-NEXT: Sub Modules:
61 // CHECK-FOO-NEXT: Global Module Fragment '<global>' is at index #4
62 // CHECK-FOO-NEXT: Imports:
63 // CHECK-FOO-NEXT: Interface Unit 'A' is at index #1
64 // CHECK-FOO-NEXT: Exports:
65 // CHECK-FOO-NEXT: Interface Unit 'B' is at index #2