| Alexey Samsonov | 9ab7362 | 2012-12-03 19:12:58 +0000 | [diff] [blame] | 1 | // General blacklist usage. | 
| Alexey Samsonov | 0c127d7 | 2013-08-19 13:59:22 +0000 | [diff] [blame] | 2 |  | 
|  | 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 Samsonov | 9ab7362 | 2012-12-03 19:12:58 +0000 | [diff] [blame] | 10 | // CHECK-BLACKLIST: -fsanitize-blacklist | 
|  | 11 |  | 
|  | 12 | // Ignore -fsanitize-blacklist flag if there is no -fsanitize flag. | 
| Alexey Samsonov | 0c127d7 | 2013-08-19 13:59:22 +0000 | [diff] [blame] | 13 | // RUN: %clang -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE | 
| Alexey Samsonov | 9ab7362 | 2012-12-03 19:12:58 +0000 | [diff] [blame] | 14 | // CHECK-NO-SANITIZE-NOT: -fsanitize-blacklist | 
|  | 15 |  | 
|  | 16 | // Flag -fno-sanitize-blacklist wins if it is specified later. | 
| Alexey Samsonov | 0c127d7 | 2013-08-19 13:59:22 +0000 | [diff] [blame] | 17 | // RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST | 
| Alexey Samsonov | 9ab7362 | 2012-12-03 19:12:58 +0000 | [diff] [blame] | 18 | // 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 Takumi | 55a8d1d | 2012-12-03 23:29:49 +0000 | [diff] [blame] | 23 |  | 
| Alexey Samsonov | 0c127d7 | 2013-08-19 13:59:22 +0000 | [diff] [blame] | 24 | // 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 |