2 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -module-file-info %t/a.pcm | FileCheck %t/a.cppm
7 // RUN: %clang_cc1 -std=c++20 %t/b.cpp -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
8 // RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm
9 // RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fmodule-file=c=%t/c.pcm
11 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
12 // RUN: %clang_cc1 -std=c++20 %t/b.cpp -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
13 // RUN: %clang_cc1 -std=c++20 %t/c.cppm -fsyntax-only -verify
14 // RUN: %clang_cc1 -module-file-info %t/a.pcm | FileCheck %t/a.cppm
18 export extern "C++" int foo() { return 43; }
26 extern "C++" void f1();
27 extern "C++" void f2();
28 extern "C++" void f3();
31 extern "C++" void unexported();
33 // CHECK: Sub Modules:
34 // CHECK-NEXT: Implicit Module Fragment '<implicit global>'
45 unexported(); // expected-error {{declaration of 'unexported' must be imported from module 'a' before it is required}}
46 // expected-note@a.cppm:15 {{declaration here is not visible}}
51 // expected-no-diagnostics
58 extern "C++" export int g();
66 int use_of_nonexported() {
67 return h(); // expected-error {{declaration of 'h' must be imported from module 'c' before it is required}}
68 // expected-note@c.cppm:5 {{declaration here is not visible}}