summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2019-10-07 22:36:19 +0000
committerJan Korous <jkorous@apple.com>2019-10-07 22:36:19 +0000
commit96ac97a4213287003f08636d0c372b3f71e9cfca (patch)
tree4bb2d0d433f81536f94fe8b5de7d0431e500ef18 /clang/test/CodeGen
parentf9b67b810e2d413606b0d5891ed9477d819bcab9 (diff)
downloadbcm5719-llvm-96ac97a4213287003f08636d0c372b3f71e9cfca.tar.gz
bcm5719-llvm-96ac97a4213287003f08636d0c372b3f71e9cfca.zip
Add VFS support for sanitizers' blacklist
Differential Revision: https://reviews.llvm.org/D67742 llvm-svn: 373977
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml15
-rw-r--r--clang/test/CodeGen/ubsan-blacklist.c11
2 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml b/clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml
new file mode 100644
index 00000000000..df2b2218976
--- /dev/null
+++ b/clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml
@@ -0,0 +1,15 @@
+{
+ 'version': 0,
+ 'roots': [
+ { 'name': '@DIR@', 'type': 'directory',
+ 'contents': [
+ { 'name': 'only-virtual-file.blacklist', 'type': 'file',
+ 'external-contents': '@REAL_FILE@'
+ },
+ { 'name': 'invalid-virtual-file.blacklist', 'type': 'file',
+ 'external-contents': '@NONEXISTENT_FILE@'
+ }
+ ]
+ }
+ ]
+}
diff --git a/clang/test/CodeGen/ubsan-blacklist.c b/clang/test/CodeGen/ubsan-blacklist.c
index 666003bd923..d6b4b714314 100644
--- a/clang/test/CodeGen/ubsan-blacklist.c
+++ b/clang/test/CodeGen/ubsan-blacklist.c
@@ -5,6 +5,17 @@
// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-blacklist=%t-func.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-blacklist=%t-file.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FILE
+// RUN: rm -f %t-vfsoverlay.yaml
+// RUN: rm -f %t-nonexistent.blacklist
+// RUN: sed -e "s|@DIR@|%T|g" %S/Inputs/sanitizer-blacklist-vfsoverlay.yaml | sed -e "s|@REAL_FILE@|%t-func.blacklist|g" | sed -e "s|@NONEXISTENT_FILE@|%t-nonexistent.blacklist|g" > %t-vfsoverlay.yaml
+// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%T/only-virtual-file.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
+
+// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%T/invalid-virtual-file.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID-MAPPED-FILE
+// INVALID-MAPPED-FILE: invalid-virtual-file.blacklist': No such file or directory
+
+// RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%t-nonexistent.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID
+// INVALID: nonexistent.blacklist': No such file or directory
+
unsigned i;
// DEFAULT: @hash
OpenPOWER on IntegriCloud