blob: 690bc877952ac0914ed8699099c22da099aaf169 [file] [log] [blame]
Alexey Samsonov9ab73622012-12-03 19:12:58 +00001// General blacklist usage.
Alexey Samsonov0c127d72013-08-19 13:59:22 +00002
3// PR12920
4// REQUIRES: clang-driver, shell
5
6// RUN: echo "fun:foo" > %t.good
7// RUN: echo "badline" > %t.bad
8
9// RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST
Alexey Samsonov9ab73622012-12-03 19:12:58 +000010// CHECK-BLACKLIST: -fsanitize-blacklist
11
12// Ignore -fsanitize-blacklist flag if there is no -fsanitize flag.
Alexey Samsonov0c127d72013-08-19 13:59:22 +000013// RUN: %clang -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE
Alexey Samsonov9ab73622012-12-03 19:12:58 +000014// CHECK-NO-SANITIZE-NOT: -fsanitize-blacklist
15
16// Flag -fno-sanitize-blacklist wins if it is specified later.
Alexey Samsonov0c127d72013-08-19 13:59:22 +000017// RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST
Alexey Samsonov9ab73622012-12-03 19:12:58 +000018// CHECK-NO-BLACKLIST-NOT: -fsanitize-blacklist
19
20// Driver barks on unexisting blacklist files.
21// RUN: %clang -fno-sanitize-blacklist -fsanitize-blacklist=unexisting.txt %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SUCH-FILE
22// CHECK-NO-SUCH-FILE: error: no such file or directory: 'unexisting.txt'
NAKAMURA Takumi55a8d1d2012-12-03 23:29:49 +000023
Alexey Samsonov0c127d72013-08-19 13:59:22 +000024// Driver properly reports malformed blacklist files.
25// RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.bad %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BAD-BLACKLIST
26// CHECK-BAD-BLACKLIST: error: malformed sanitizer blacklist