2012-12-04 03:12:58 +08:00
|
|
|
// General blacklist usage.
|
2013-08-19 21:59:22 +08:00
|
|
|
|
|
|
|
// PR12920
|
2016-10-21 07:11:45 +08:00
|
|
|
// REQUIRES: clang-driver
|
2013-08-19 21:59:22 +08:00
|
|
|
|
2015-02-12 11:37:55 +08:00
|
|
|
// Make sure we don't match the -NOT lines with the linker invocation.
|
|
|
|
// Delimiters match the start of the cc1 and the start of the linker lines
|
|
|
|
// for fragile tests.
|
|
|
|
// DELIMITERS: {{^ *"}}
|
|
|
|
|
2013-08-19 21:59:22 +08:00
|
|
|
// RUN: echo "fun:foo" > %t.good
|
2015-02-05 01:40:08 +08:00
|
|
|
// RUN: echo "fun:bar" > %t.second
|
2013-08-19 21:59:22 +08:00
|
|
|
// RUN: echo "badline" > %t.bad
|
|
|
|
|
2015-09-04 03:11:42 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST
|
2017-12-09 09:32:07 +08:00
|
|
|
// RUN: %clang -target aarch64-linux-gnu -fsanitize=hwaddress -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST
|
2015-09-03 04:02:38 +08:00
|
|
|
// CHECK-BLACKLIST: -fsanitize-blacklist={{.*}}.good" "-fsanitize-blacklist={{.*}}.second
|
|
|
|
|
|
|
|
// Now, check for -fdepfile-entry flags.
|
2015-09-04 03:11:42 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST2
|
2015-09-03 04:02:38 +08:00
|
|
|
// CHECK-BLACKLIST2: -fdepfile-entry={{.*}}.good" "-fdepfile-entry={{.*}}.second
|
|
|
|
|
|
|
|
// Check that the default blacklist is not added as an extra dependency.
|
2018-02-21 07:17:41 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-BLACKLIST-ASAN --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
|
2017-12-09 10:15:42 +08:00
|
|
|
// CHECK-DEFAULT-BLACKLIST-ASAN: -fsanitize-blacklist={{.*[^w]}}asan_blacklist.txt
|
2018-02-21 07:17:41 +08:00
|
|
|
// RUN: %clang -target aarch64-linux-gnu -fsanitize=hwaddress -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-BLACKLIST-HWASAN --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
|
2017-12-09 10:15:42 +08:00
|
|
|
// CHECK-DEFAULT-BLACKLIST-HWASAN: -fsanitize-blacklist={{.*}}hwasan_blacklist.txt
|
2017-09-13 02:58:00 +08:00
|
|
|
|
2018-02-21 07:17:41 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=nullability -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=alignment -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
|
2017-09-13 02:58:00 +08:00
|
|
|
// CHECK-DEFAULT-UBSAN-BLACKLIST: -fsanitize-blacklist={{.*}}ubsan_blacklist.txt
|
2012-12-04 03:12:58 +08:00
|
|
|
|
2018-02-21 07:17:41 +08:00
|
|
|
// Check that combining ubsan and another sanitizer results in both blacklists being used.
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined,address -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-UBSAN-BLACKLIST --check-prefix=CHECK-DEFAULT-ASAN-BLACKLIST --implicit-check-not=fdepfile-entry --implicit-check-not=-fsanitize-blacklist=
|
|
|
|
|
2012-12-04 03:12:58 +08:00
|
|
|
// Ignore -fsanitize-blacklist flag if there is no -fsanitize flag.
|
2015-09-04 03:11:42 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE --check-prefix=DELIMITERS
|
2012-12-04 03:12:58 +08:00
|
|
|
// CHECK-NO-SANITIZE-NOT: -fsanitize-blacklist
|
|
|
|
|
2015-09-03 04:02:38 +08:00
|
|
|
// Ignore -fsanitize-blacklist flag if there is no -fsanitize flag.
|
|
|
|
// Now, check for the absense of -fdepfile-entry flags.
|
2015-09-04 03:11:42 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE2 --check-prefix=DELIMITERS
|
2015-09-03 04:02:38 +08:00
|
|
|
// CHECK-NO-SANITIZE2-NOT: -fdepfile-entry
|
|
|
|
|
2012-12-04 03:12:58 +08:00
|
|
|
// Flag -fno-sanitize-blacklist wins if it is specified later.
|
2015-09-04 03:11:42 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST --check-prefix=DELIMITERS
|
2012-12-04 03:12:58 +08:00
|
|
|
// CHECK-NO-BLACKLIST-NOT: -fsanitize-blacklist
|
|
|
|
|
|
|
|
// Driver barks on unexisting blacklist files.
|
2015-09-04 03:11:42 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fno-sanitize-blacklist -fsanitize-blacklist=unexisting.txt %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SUCH-FILE
|
2012-12-04 03:12:58 +08:00
|
|
|
// CHECK-NO-SUCH-FILE: error: no such file or directory: 'unexisting.txt'
|
2012-12-04 07:29:49 +08:00
|
|
|
|
2013-08-19 21:59:22 +08:00
|
|
|
// Driver properly reports malformed blacklist files.
|
2015-09-04 03:11:42 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.second -fsanitize-blacklist=%t.bad -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BAD-BLACKLIST
|
2015-02-05 01:40:08 +08:00
|
|
|
// CHECK-BAD-BLACKLIST: error: malformed sanitizer blacklist: 'error parsing file '{{.*}}.bad': malformed line 1: 'badline''
|
|
|
|
|
|
|
|
// -fno-sanitize-blacklist disables all blacklists specified earlier.
|
2018-02-21 07:17:41 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-FIRST-DISABLED --implicit-check-not=-fsanitize-blacklist=
|
2015-02-05 01:40:08 +08:00
|
|
|
// CHECK-ONLY_FIRST-DISABLED-NOT: good
|
|
|
|
// CHECK-ONLY-FIRST-DISABLED: -fsanitize-blacklist={{.*}}.second
|
|
|
|
// CHECK-ONLY_FIRST-DISABLED-NOT: good
|
2015-02-12 11:37:55 +08:00
|
|
|
|
|
|
|
// DELIMITERS: {{^ *"}}
|