summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2019-11-07 13:56:14 -0800
committerJan Korous <jkorous@apple.com>2019-11-07 14:06:43 -0800
commit03b84e4f6d0e1c04f22d69cc445f36e1f713beb4 (patch)
tree16c97f555ff1732509a31aabbf65e3fbf04c8791 /clang/test/Frontend
parentad3c9d46fe39af1762a7be75d754723be9a5594a (diff)
downloadbcm5719-llvm-03b84e4f6d0e1c04f22d69cc445f36e1f713beb4.tar.gz
bcm5719-llvm-03b84e4f6d0e1c04f22d69cc445f36e1f713beb4.zip
[clang] Report sanitizer blacklist as a dependency in cc1
Previously these were reported from the driver which blocked clang-scan-deps from getting the full set of dependencies from cc1 commands. Also the default sanitizer blacklist that is added in driver was never reported as a dependency. I introduced -fsanitize-system-blacklist cc1 option to keep track of which blacklists were user-specified and which were added by driver and clang -MD now also reports system blacklists as dependencies. Differential Revision: https://reviews.llvm.org/D69290
Diffstat (limited to 'clang/test/Frontend')
-rw-r--r--clang/test/Frontend/dependency-gen.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Frontend/dependency-gen.c b/clang/test/Frontend/dependency-gen.c
index 963419cb118..1db9b04c1d9 100644
--- a/clang/test/Frontend/dependency-gen.c
+++ b/clang/test/Frontend/dependency-gen.c
@@ -27,3 +27,20 @@
#ifndef INCLUDE_FLAG_TEST
#include <x.h>
#endif
+
+// RUN: echo "fun:foo" > %t.blacklist1
+// RUN: echo "fun:foo" > %t.blacklist2
+// RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_cfi_blacklist -fsanitize=cfi-vcall -flto -fvisibility=hidden -fsanitize-blacklist=%t.blacklist1 -fsanitize-blacklist=%t.blacklist2 -I ./ | FileCheck -check-prefix=TWO-BLACK-LISTS %s
+// TWO-BLACK-LISTS: dependency-gen.o:
+// TWO-BLACK-LISTS-DAG: blacklist1
+// TWO-BLACK-LISTS-DAG: blacklist2
+// TWO-BLACK-LISTS-DAG: x.h
+// TWO-BLACK-LISTS-DAG: dependency-gen.c
+
+// RUN: %clang -MD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_cfi_blacklist -fsanitize=cfi-vcall -flto -fvisibility=hidden -I ./ | FileCheck -check-prefix=USER-AND-SYS-DEPS %s
+// USER-AND-SYS-DEPS: dependency-gen.o:
+// USER-AND-SYS-DEPS-DAG: cfi_blacklist.txt
+
+// RUN: %clang -MMD -MF - %s -fsyntax-only -resource-dir=%S/Inputs/resource_dir_with_cfi_blacklist -fsanitize=cfi-vcall -flto -fvisibility=hidden -I ./ | FileCheck -check-prefix=ONLY-USER-DEPS %s
+// ONLY-USER-DEPS: dependency-gen.o:
+// NOT-ONLY-USER-DEPS: cfi_blacklist.txt \ No newline at end of file
OpenPOWER on IntegriCloud