summaryrefslogtreecommitdiffstats
path: root/clang/test/VFS/module-import.m
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-04-04 16:42:53 +0000
committerBen Langmuir <blangmuir@apple.com>2014-04-04 16:42:53 +0000
commitf9a6ac213a31b7cc90054034f6a4ea1846d1b360 (patch)
treeba81b520444d3c369a2fb3aff91f92c122a45fbb /clang/test/VFS/module-import.m
parent6da86e8529ff4720d1aa57a79e5efe35d486337b (diff)
downloadbcm5719-llvm-f9a6ac213a31b7cc90054034f6a4ea1846d1b360.tar.gz
bcm5719-llvm-f9a6ac213a31b7cc90054034f6a4ea1846d1b360.zip
Add a test where the module map is overriden in the vfs
Specifically, we pass two -ivfsoverlay yaml files, and the topmost one remaps the module map file. llvm-svn: 205632
Diffstat (limited to 'clang/test/VFS/module-import.m')
-rw-r--r--clang/test/VFS/module-import.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/VFS/module-import.m b/clang/test/VFS/module-import.m
index 3cfd906d767..d2adcfedfaa 100644
--- a/clang/test/VFS/module-import.m
+++ b/clang/test/VFS/module-import.m
@@ -8,3 +8,20 @@
void foo() {
bar();
}
+
+// Import a submodule that is defined in actual_module2.map, which is only
+// mapped in vfsoverlay2.yaml.
+#ifdef IMPORT2
+@import not_real.from_second_module;
+// CHECK-VFS2: error: no submodule
+#endif
+
+// Override the module map (vfsoverlay2 on top)
+// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay2.yaml > %t2.yaml
+// RUN: %clang_cc1 -Werror -fmodules -fmodules-cache-path=%t -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -I %t -fsyntax-only %s
+
+// vfsoverlay2 not present
+// RUN: not %clang_cc1 -Werror -fmodules -fmodules-cache-path=%t -ivfsoverlay %t.yaml -I %t -fsyntax-only %s -DIMPORT2 2>&1 | FileCheck -check-prefix=CHECK-VFS2 %s
+
+// vfsoverlay2 on the bottom
+// RUN: not %clang_cc1 -Werror -fmodules -fmodules-cache-path=%t -ivfsoverlay %t2.yaml -ivfsoverlay %t.yaml -I %t -fsyntax-only %s -DIMPORT2 2>&1 | FileCheck -check-prefix=CHECK-VFS2 %s
OpenPOWER on IntegriCloud