brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 6564558 Raw
54 lines · cpp
1// RUN: rm -rf %t2//3// RUN: %clang_cc1 %s \4// RUN:   -fmodules-local-submodule-visibility \5// RUN:   -fmodule-map-file=%S/Inputs/lsv-private-macro/mod.map \6// RUN:   -I%S/Inputs/lsv-private-macro -fmodule-name=self \7// RUN:   -verify=expected-lsv8//9// RUN: %clang_cc1 %s \10// RUN:   -fmodules -fmodules-cache-path=%t \11// RUN:   -fmodule-map-file=%S/Inputs/lsv-private-macro/mod.map \12// RUN:   -I%S/Inputs/lsv-private-macro -fmodule-name=self \13// RUN:   -verify=expected-nolsv14//15// RUN: %clang_cc1 %s \16// RUN:   -fmodules -fmodules-cache-path=%t \17// RUN:   -fmodules-local-submodule-visibility \18// RUN:   -fmodule-map-file=%S/Inputs/lsv-private-macro/mod.map \19// RUN:   -I%S/Inputs/lsv-private-macro -fmodule-name=self \20// RUN:   -verify=expected-lsv21 22#include "self.h"23 24// With local submodule visibility enabled, private macros don't leak out of25// their respective submodules, even within the same top-level module.26// expected-lsv-no-diagnostics27 28// expected-nolsv-error@+2 {{SELF_PRIVATE defined}}29#ifdef SELF_PRIVATE30#error SELF_PRIVATE defined31#endif32 33#ifndef SELF_PUBLIC34#error SELF_PUBLIC not defined35#endif36 37#ifndef SELF_DEFAULT38#error SELF_DEFAULT not defined39#endif40 41#include "other.h"42 43#ifdef OTHER_PRIVATE44#error OTHER_PRIVATE defined45#endif46 47#ifndef OTHER_PUBLIC48#error OTHER_PUBLIC not defined49#endif50 51#ifndef OTHER_DEFAULT52#error OTHER_DEFAULT not defined53#endif54