| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: split-file %s %t |
| 3 |
|
| 4 |
// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address %t/test.c -o - | FileCheck %s --check-prefixes=SANITIZE |
| 5 |
|
| 6 |
// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-0.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=IGNORE |
| 7 |
// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-1.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=SANITIZE |
| 8 |
// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-2.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=IGNORE |
| 9 |
// RUN: %clang -target x86_64-unknown-linux-gnu -S -emit-llvm -fsanitize=address -fsanitize-ignorelist=%t/order-3.ignorelist %t/test.c -o - | FileCheck %s --check-prefixes=SANITIZE |
| 10 |
|
| 11 |
// The same type can appear multiple times within an ignorelist. Any ``=sanitize`` type |
| 12 |
// entries enable sanitizer instrumentation, even if it was ignored by entries before. |
| 13 |
// If multiple entries match the source, then the latest entry takes the |
| 14 |
// precedence. |
| 15 |
|
| 16 |
//--- order-0.ignorelist |
| 17 |
global:global_array |
| 18 |
|
| 19 |
//--- order-1.ignorelist |
| 20 |
global:global_array |
| 21 |
global:global_array=sanitize |
| 22 |
|
| 23 |
//--- order-2.ignorelist |
| 24 |
global:* |
| 25 |
global:global_array=sanitize |
| 26 |
global:global_array |
| 27 |
|
| 28 |
//--- order-3.ignorelist |
| 29 |
global:* |
| 30 |
global:global_array=sanitize |
| 31 |
global:global* |
| 32 |
global:*array=sanitize |
| 33 |
|
| 34 |
//--- test.c |
| 35 |
// SANITIZE: @global_array ={{.*}} global {{.*}}, comdat, align {{.*}} |
| 36 |
// IGNORE: @global_array ={{.*}} global {{.*}}, no_sanitize_address, align {{.*}} |
| 37 |
unsigned global_array[100] = {-1}; |