brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · c5a6261 Raw
86 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-module-interface -o %t/M.pcm6// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t7 8// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-reduced-module-interface -o %t/M.pcm9// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t10 11// RUN: %clang_cc1 -std=c++20 %t/M0.cppm -emit-module-interface -o %t/M.pcm12// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t -DMODULE_LOCAL13// RUN: %clang_cc1 -std=c++20 %t/M0.cpp -fsyntax-only -verify -fprebuilt-module-path=%t14 15// RUN: %clang_cc1 -std=c++20 %t/M0.cppm -emit-reduced-module-interface -o %t/M.pcm16// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t -DMODULE_LOCAL17// RUN: %clang_cc1 -std=c++20 %t/M0.cpp -fsyntax-only -verify -fprebuilt-module-path=%t18 19// RUN: %clang_cc1 -std=c++20 %t/M2.cppm -emit-module-interface -o %t/M.pcm20// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t21 22// RUN: %clang_cc1 -std=c++20 %t/M2.cppm -emit-reduced-module-interface -o %t/M.pcm23// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t24 25// RUN: %clang_cc1 -std=c++20 %t/M3.cppm -emit-reduced-module-interface -o %t/M.pcm26// RUN: %clang_cc1 -std=c++20 %t/use2.cpp -fsyntax-only -verify -fprebuilt-module-path=%t27 28//--- enum.h29enum {    SomeName,    };30 31//--- M.cppm32module;33#include "enum.h"34export module M;35export auto e = SomeName;36 37//--- M0.cppm38export module M;39enum {    SomeName,    };40export auto e = SomeName;41 42//--- M0.cpp43// expected-no-diagnostics44module M;45auto a = SomeName;46 47//--- use.cpp48import M;49auto a = SomeName; // expected-error {{use of undeclared identifier 'SomeName'}}50auto b = decltype(e)::SomeName;51 52//--- enum1.h53extern "C++" {54enum {    SomeName,    };55}56 57//--- M2.cppm58module;59#include "enum1.h"60export module M;61export auto e = SomeName;62 63//--- enums.h64namespace nn {65enum E { Value };66enum E2 { VisibleEnum };67enum AlwaysVisibleEnums { UnconditionallyVisible };68}69 70//--- M3.cppm71module;72#include "enums.h"73export module M;74export namespace nn {75    using nn::E2::VisibleEnum;76    using nn::AlwaysVisibleEnums;77}78auto e1 = nn::Value;79auto e2 = nn::VisibleEnum;80 81//--- use2.cpp82import M;83auto e = nn::Value1; // expected-error {{no member named 'Value1' in namespace 'nn'}}84auto e2 = nn::VisibleEnum;85auto e3 = nn::UnconditionallyVisible;86