brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 65c4b83 Raw
39 lines · cpp
1// RUN: rm -rf %t2// RUN: split-file %s %t3 4 5// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface %t/A.cpp -o %t/A.pcm6// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface %t/myV.cpp -o %t/myV.pcm7// RUN: %clang_cc1 -std=c++20 -verify -emit-module-interface -fmodule-file=V=%t/myV.pcm %t/partition.cpp -o %t/partition.pcm8// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -fmodule-file=V=%t/myV.pcm -fmodule-file=A=%t/A.pcm -fmodule-file=A:partition=%t/partition.pcm %t/interface.cpp9 10//--- A.cpp11// expected-no-diagnostics12export module A;13 14//--- myV.cpp15// expected-no-diagnostics16export module V;17 18export struct myV{};19 20//--- uses_vector.h21// expected-no-diagnostics22#ifndef x23#define x24 25import V;26#endif27 28//--- partition.cpp29// expected-no-diagnostics30module;31#include "uses_vector.h" // textually expands to import V;32module A:partition;33 34//--- interface.cpp35module A;36import :partition;37myV V; // expected-error {{declaration of 'myV' must be imported from module 'V' before it is required}}38       // expected-note@myV.cpp:4 {{declaration here is not visible}}39