summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/submodule-visibility-cycles.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-05-21 01:20:10 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-05-21 01:20:10 +0000
commit04765ae01e936a3f2bc980ebd8fc7ea8a4760636 (patch)
treeb5a150687a94b1b7cf20fbad6067172a2013e341 /clang/test/Modules/submodule-visibility-cycles.cpp
parentde0aff3e9109ac9444b4408aa7619204344f54ed (diff)
downloadbcm5719-llvm-04765ae01e936a3f2bc980ebd8fc7ea8a4760636.tar.gz
bcm5719-llvm-04765ae01e936a3f2bc980ebd8fc7ea8a4760636.zip
[modules] If we re-enter a submodule from within itself (when submodule
visibility is enabled) or leave and re-enter it, restore the macro and module visibility state from last time we were in that submodule. This allows mutually-#including header files to stand a chance at being modularized with local visibility enabled. llvm-svn: 237871
Diffstat (limited to 'clang/test/Modules/submodule-visibility-cycles.cpp')
-rw-r--r--clang/test/Modules/submodule-visibility-cycles.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Modules/submodule-visibility-cycles.cpp b/clang/test/Modules/submodule-visibility-cycles.cpp
new file mode 100644
index 00000000000..fca8df9f77e
--- /dev/null
+++ b/clang/test/Modules/submodule-visibility-cycles.cpp
@@ -0,0 +1,10 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fno-modules-error-recovery -fmodules-local-submodule-visibility -fmodules-cache-path=%t -I%S/Inputs/submodule-visibility -verify %s
+
+#include "cycle1.h"
+C1 c1;
+C2 c2; // expected-error {{must be imported}} expected-error {{}}
+// expected-note@cycle2.h:6 {{here}}
+
+#include "cycle2.h"
+C2 c3;
OpenPOWER on IntegriCloud