summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend
diff options
context:
space:
mode:
authorIvan Krasin <krasin@chromium.org>2015-08-13 04:04:37 +0000
committerIvan Krasin <krasin@chromium.org>2015-08-13 04:04:37 +0000
commit1193f2cbc021f040eef6f97ec72dad5fb1efb7b1 (patch)
tree921577b0f91fddfff3a6ab823d8ea049d7898919 /clang/test/Frontend
parent1142f83ce2c28012e611903635a775a8b8944580 (diff)
downloadbcm5719-llvm-1193f2cbc021f040eef6f97ec72dad5fb1efb7b1.tar.gz
bcm5719-llvm-1193f2cbc021f040eef6f97ec72dad5fb1efb7b1.zip
Add sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD.
Summary: Clang sanitizers, such as AddressSanitizer, ThreadSanitizer, MemorySanitizer, Control Flow Integrity and others, use blacklists to specify which types / functions should not be instrumented to avoid false positives or suppress known failures. This change adds the blacklist filenames to the list of dependencies of the rules, generated with -M/-MM/-MD/-MMD. This lets CMake/Ninja recognize that certain C/C++/ObjC files need to be recompiled (if a blacklist is updated). Reviewers: pcc Subscribers: rsmith, honggyu.kim, pcc, cfe-commits Differential Revision: http://reviews.llvm.org/D11968 llvm-svn: 244867
Diffstat (limited to 'clang/test/Frontend')
-rw-r--r--clang/test/Frontend/dependency-gen.c11
-rw-r--r--clang/test/Frontend/print-header-includes.c8
2 files changed, 18 insertions, 1 deletions
diff --git a/clang/test/Frontend/dependency-gen.c b/clang/test/Frontend/dependency-gen.c
index 0465dc864e4..4df1f9536ee 100644
--- a/clang/test/Frontend/dependency-gen.c
+++ b/clang/test/Frontend/dependency-gen.c
@@ -20,7 +20,16 @@
// RUN: cd a/b
// RUN: %clang -MD -MF - %s -fsyntax-only -I ./ | FileCheck -check-prefix=CHECK-SIX %s
// CHECK-SIX: {{ }}x.h
-
+// RUN: echo "fun:foo" > %t.blacklist
+// RUN: %clang -MD -MF - %s -fsyntax-only -fsanitize=cfi-vcall -flto -fsanitize-blacklist=%t.blacklist -I ./ | FileCheck -check-prefix=CHECK-SEVEN %s
+// CHECK-SEVEN: .blacklist
+// CHECK-SEVEN: {{ }}x.h
+// RUN: %clang -MD -MF - %s -fsyntax-only -fsanitize=address -flto -I . | FileCheck -check-prefix=CHECK-EIGHT %s
+// CHECK-EIGHT: asan_blacklist.txt
+// CHECK-EIGHT: {{ }}x.h
+// RUN: %clang -MD -MF - %s -fsyntax-only -fsanitize=address -flto -I . -fno-sanitize-blacklist | FileCheck -check-prefix=CHECK-NINE %s
+// CHECK-NINE-NOT: asan_blacklist.txt
+// CHECK-NINE: {{ }}x.h
#ifndef INCLUDE_FLAG_TEST
#include <x.h>
#endif
diff --git a/clang/test/Frontend/print-header-includes.c b/clang/test/Frontend/print-header-includes.c
index 966b4af8606..53b3eb09734 100644
--- a/clang/test/Frontend/print-header-includes.c
+++ b/clang/test/Frontend/print-header-includes.c
@@ -13,4 +13,12 @@
// MS: Note: including file: {{.*test2.h}}
// MS-NOT: Note
+// RUN: echo "fun:foo" > %t.blacklist
+// RUN: %clang_cc1 -fsanitize=address -fsanitize-blacklist=%t.blacklist -E --show-includes -o %t.out %s > %t.stdout
+// RUN: FileCheck --check-prefix=MS-BLACKLIST < %t.stdout %s
+// MS-BLACKLIST: Note: including file: {{.*\.blacklist}}
+// MS-BLACKLIST: Note: including file: {{.*test.h}}
+// MS-BLACKLIST: Note: including file: {{.*test2.h}}
+// MS-BLACKLIST-NOT: Note
+
#include "Inputs/test.h"
OpenPOWER on IntegriCloud