summaryrefslogtreecommitdiffstats
path: root/clang/test/VFS/module_missing_vfs.m
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2018-03-23 17:37:27 +0000
committerBen Langmuir <blangmuir@apple.com>2018-03-23 17:37:27 +0000
commit005c2e57a658bc18529de5027d52619dc4a2a72c (patch)
tree486d6d2a2869ab09f3065e360b8c7ba0689c5a7e /clang/test/VFS/module_missing_vfs.m
parenta237866faff488edf9c822b38e16af3de13c0e90 (diff)
downloadbcm5719-llvm-005c2e57a658bc18529de5027d52619dc4a2a72c.tar.gz
bcm5719-llvm-005c2e57a658bc18529de5027d52619dc4a2a72c.zip
[vfs] Don't bail out after a missing -ivfsoverlay file
This make -ivfsoverlay behave more like other fatal errors (e.g. missing -include file) by skipping the missing file instead of bailing out of the whole compilation. This makes it possible for libclang to still provide some functionallity as well as to correctly produce the fatal error diagnostic (previously we lost the diagnostic in libclang since there was no TU to tie it to). rdar://33385423 llvm-svn: 328337
Diffstat (limited to 'clang/test/VFS/module_missing_vfs.m')
-rw-r--r--clang/test/VFS/module_missing_vfs.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/VFS/module_missing_vfs.m b/clang/test/VFS/module_missing_vfs.m
new file mode 100644
index 00000000000..4c4ee4dd896
--- /dev/null
+++ b/clang/test/VFS/module_missing_vfs.m
@@ -0,0 +1,16 @@
+// REQUIRES: shell
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: echo "void funcA(void);" >> %t/a.h
+
+// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/mcp -I %S/Inputs/MissingVFS %s -fsyntax-only -ivfsoverlay %t/vfs.yaml 2>&1 | FileCheck %s -check-prefix=ERROR
+// ERROR: virtual filesystem overlay file '{{.*}}' not found
+// RUN: find %t/mcp -name "A-*.pcm" | count 1
+
+// RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/MissingVFS/vfsoverlay.yaml > %t/vfs.yaml
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/mcp -I %S/Inputs/MissingVFS %s -fsyntax-only -ivfsoverlay %t/vfs.yaml
+// RUN: find %t/mcp -name "A-*.pcm" | count 1
+
+@import A;
+void test(void) {
+ funcA();
+}
OpenPOWER on IntegriCloud