aboutsummaryrefslogtreecommitdiff
path: root/test/Modules/wildcard-submodule-exports.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-05 17:28:06 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-05 17:28:06 +0000
commit0adaa880993ad23186c87c7f98e7a3fd2697742c (patch)
treead45854454861d185a11fb6dd96498f454d48441 /test/Modules/wildcard-submodule-exports.cpp
parent4bc8738d837e5d401235f99e55277338e20e3651 (diff)
Implement support for wildcard exports in modules, allowing a module
to re-export anything that it imports. This opt-in feature makes a module behave more like a header, because it can be used to re-export the transitive closure of a (sub)module's dependencies. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/wildcard-submodule-exports.cpp')
-rw-r--r--test/Modules/wildcard-submodule-exports.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Modules/wildcard-submodule-exports.cpp b/test/Modules/wildcard-submodule-exports.cpp
new file mode 100644
index 0000000000..b892acbe59
--- /dev/null
+++ b/test/Modules/wildcard-submodule-exports.cpp
@@ -0,0 +1,25 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/wildcard-submodule-exports %s -verify
+
+__import_module__ C.One;
+
+void test_C_One() {
+ int *A1_ptr = A1;
+ long *C1_ptr = C1;
+ (void)B1; // expected-error{{use of undeclared identifier 'B1'}}
+}
+
+__import_module__ C.Two;
+
+void test_C_Two() {
+ unsigned int *A2_ptr = A2;
+ unsigned short *B2_ptr = B2;
+ unsigned long *C2_ptr = C2;
+}
+
+__import_module__ B.One;
+
+void test_B_One() {
+ short *B1_ptr = B1;
+}
+