summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/export_as_test.modulemap9
-rw-r--r--clang/test/Modules/export_as_test.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/export_as_test.modulemap b/clang/test/Modules/Inputs/export_as_test.modulemap
new file mode 100644
index 00000000000..4aaec4194ef
--- /dev/null
+++ b/clang/test/Modules/Inputs/export_as_test.modulemap
@@ -0,0 +1,9 @@
+module PrivateFoo {
+ export_as Foo
+ export_as Bar
+ export_as Bar
+
+ module Sub {
+ export_as Wibble
+ }
+}
diff --git a/clang/test/Modules/export_as_test.c b/clang/test/Modules/export_as_test.c
new file mode 100644
index 00000000000..a73d6bfc460
--- /dev/null
+++ b/clang/test/Modules/export_as_test.c
@@ -0,0 +1,9 @@
+// RUN: rm -rf %t
+// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%S/Inputs/export_as_test.modulemap %s 2> %t.err
+// RUN: FileCheck %s < %t.err
+
+// CHECK: export_as_test.modulemap:3:13: error: conflicting re-export of module 'PrivateFoo' as 'Foo' or 'Bar'
+// CHECK: export_as_test.modulemap:4:13: warning: module 'PrivateFoo' already re-exported as 'Bar'
+// CHECK: export_as_test.modulemap:7:15: error: only top-level modules can be re-exported as public
+
+
OpenPOWER on IntegriCloud