brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · ebc76ad Raw
27 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3 4// RUN: %clang_cc1 -std=c++20 %t/ExportDeclNotInModulePurview.cppm -verify -emit-module-interface -o /dev/null5// RUN: %clang_cc1 -std=c++20 %t/A.cppm -verify -emit-module-interface -o %t/A.pcm6// RUN: %clang_cc1 -std=c++20 %t/AddExport.cppm -verify -fmodule-file=A=%t/A.pcm -o /dev/null7//8// RUN: %clang_cc1 -std=c++20 %t/AddExport2.cppm -emit-module-interface -verify -o /dev/null9 10//--- ExportDeclNotInModulePurview.cppm11// expected-error@* {{missing 'export module' declaration in module interface unit}}12export int b; // expected-error {{export declaration can only be used within a module interface}}13 14//--- A.cppm15// expected-no-diagnostics16export module A;17export int a;18 19//--- AddExport.cppm20module A; // #module-decl21export int b; // expected-error {{export declaration can only be used within a module interface}}22// expected-note@#module-decl {{add 'export' here}}23 24//--- AddExport2.cppm25module A; // expected-error {{missing 'export' specifier in module declaration while building module interface}}26export int a;27