1 // General blacklist usage. 2 3 // PR12920 4 // REQUIRES: clang-driver, shell 5 6 // Make sure we don't match the -NOT lines with the linker invocation. 7 // Delimiters match the start of the cc1 and the start of the linker lines 8 // for fragile tests. 9 // DELIMITERS: {{^ *"}} 10 11 // RUN: echo "fun:foo" > %t.good 12 // RUN: echo "fun:bar" > %t.second 13 // RUN: echo "badline" > %t.bad 14 15 // RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST 16 // CHECK-BLACKLIST: -fsanitize-blacklist={{.*}}.good 17 // CHECK-BLACKLIST: -fsanitize-blacklist={{.*}}.second 18 19 // Ignore -fsanitize-blacklist flag if there is no -fsanitize flag. 20 // RUN: %clang -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE --check-prefix=DELIMITERS 21 // CHECK-NO-SANITIZE-NOT: -fsanitize-blacklist 22 23 // Flag -fno-sanitize-blacklist wins if it is specified later. 24 // RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST --check-prefix=DELIMITERS 25 // CHECK-NO-BLACKLIST-NOT: -fsanitize-blacklist 26 27 // Driver barks on unexisting blacklist files. 28 // RUN: %clang -fno-sanitize-blacklist -fsanitize-blacklist=unexisting.txt %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SUCH-FILE 29 // CHECK-NO-SUCH-FILE: error: no such file or directory: 'unexisting.txt' 30 31 // Driver properly reports malformed blacklist files. 32 // RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.second -fsanitize-blacklist=%t.bad -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BAD-BLACKLIST 33 // CHECK-BAD-BLACKLIST: error: malformed sanitizer blacklist: 'error parsing file '{{.*}}.bad': malformed line 1: 'badline'' 34 35 // -fno-sanitize-blacklist disables all blacklists specified earlier. 36 // RUN: %clang -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-FIRST-DISABLED 37 // CHECK-ONLY_FIRST-DISABLED-NOT: good 38 // CHECK-ONLY-FIRST-DISABLED: -fsanitize-blacklist={{.*}}.second 39 // CHECK-ONLY_FIRST-DISABLED-NOT: good 40 41 // DELIMITERS: {{^ *"}} 42