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 -std=c++20 %t/b.cpp -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
7 // RUN: %clang_cc1 -std=c++20 %t/c.cppm -fsyntax-only -verify
8 // RUN: %clang_cc1 -module-file-info %t/a.pcm | FileCheck %t/a.cppm
12 export extern "C++" int foo() { return 43; }
20 extern "C++" void f1();
21 extern "C++" void f2();
22 extern "C++" void f3();
25 extern "C++" void unexported();
27 // CHECK: Sub Modules:
28 // CHECK-NEXT: Implicit Module Fragment '<exported implicit global>'
29 // CHECK-NEXT: Implicit Module Fragment '<implicit global>'
40 unexported(); // expected-error {{missing '#include'; 'unexported' must be declared before it is used}}
41 // expected-note@a.cppm:15 {{declaration here is not visible}}
48 // We can't use `export` in an unnamed module.
49 export int f(); // expected-error {{export declaration can only be used within a module purview}}
52 extern "C++" export int g(); // expected-error {{export declaration can only be used within a module purview}}