summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/macro-ambiguity.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-05-01 21:22:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-05-01 21:22:17 +0000
commitee977933f7df9cef13cc06ac7fa3e4a22b72e41f (patch)
treea22ff47a085710049d757d9056439c018e405181 /clang/test/Modules/macro-ambiguity.cpp
parentf9b517c1596a7f13c4b2be68c0ff5db1b1d96afb (diff)
downloadbcm5719-llvm-ee977933f7df9cef13cc06ac7fa3e4a22b72e41f.tar.gz
bcm5719-llvm-ee977933f7df9cef13cc06ac7fa3e4a22b72e41f.zip
[modules] Add -fmodules-local-submodule-visibility flag.
This flag specifies that the normal visibility rules should be used even for local submodules (submodules of the currently-being-built module). Thus names will only be visible if a header / module that declares them has actually been included / imported, and not merely because a submodule that happened to be built earlier declared those names. This also removes the need to modularize bottom-up: textually-included headers will be included into every submodule that includes them, since their include guards will not leak between modules. So far, this only governs visibility of macros, not of declarations, so is not ready for real use yet. llvm-svn: 236350
Diffstat (limited to 'clang/test/Modules/macro-ambiguity.cpp')
-rw-r--r--clang/test/Modules/macro-ambiguity.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Modules/macro-ambiguity.cpp b/clang/test/Modules/macro-ambiguity.cpp
index ea9e4f549f0..af43b35839a 100644
--- a/clang/test/Modules/macro-ambiguity.cpp
+++ b/clang/test/Modules/macro-ambiguity.cpp
@@ -57,6 +57,27 @@
// RUN: -fmodule-file=%t/c.pcm \
// RUN: -fmodule-file=%t/d.pcm \
// RUN: -Wambiguous-macro -verify macro-ambiguity.cpp
+//
+// RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
+// RUN: -v -fmodules-local-submodule-visibility \
+// RUN: -iquote Inputs/macro-ambiguity/a/quote \
+// RUN: -isystem Inputs/macro-ambiguity/a/system \
+// RUN: -iquote Inputs/macro-ambiguity/b/quote \
+// RUN: -isystem Inputs/macro-ambiguity/b/system \
+// RUN: -iquote Inputs/macro-ambiguity/c/quote \
+// RUN: -isystem Inputs/macro-ambiguity/c/system \
+// RUN: -iquote Inputs/macro-ambiguity/d/quote \
+// RUN: -isystem Inputs/macro-ambiguity/d/system \
+// RUN: -iquote Inputs/macro-ambiguity/e/quote \
+// RUN: -isystem Inputs/macro-ambiguity/e/system \
+// RUN: -fno-implicit-modules -fno-modules-implicit-maps \
+// RUN: -fmodule-map-file-home-is-cwd \
+// RUN: -fmodule-map-file=Inputs/macro-ambiguity/module.modulemap \
+// RUN: -fmodule-file=%t/a.pcm \
+// RUN: -fmodule-file=%t/b.pcm \
+// RUN: -fmodule-file=%t/c.pcm \
+// RUN: -fmodule-file=%t/d.pcm \
+// RUN: -Wambiguous-macro -verify macro-ambiguity.cpp
// Include the textual headers first to maximize the ways in which things can
// become ambiguous.
OpenPOWER on IntegriCloud