| 1 |
/// Test mainfile in a sanitizer special case list. |
| 2 |
// RUN: rm -rf %t && split-file %s %t && cd %t |
| 3 |
// RUN: %clang_cc1 -emit-llvm -triple x86_64 -fsanitize=address,alignment a.c -o - | FileCheck %s --check-prefixes=CHECK,DEFAULT |
| 4 |
// RUN: %clang_cc1 -emit-llvm -triple x86_64 -fsanitize=address,alignment -fsanitize-ignorelist=a.list a.c -o - | FileCheck %s --check-prefixes=CHECK,IGNORE |
| 5 |
// RUN: %clang_cc1 -emit-llvm -triple x86_64 -fsanitize=address,alignment -fsanitize-ignorelist=b.list a.c -o - | FileCheck %s --check-prefixes=CHECK,IGNORE |
| 6 |
|
| 7 |
//--- a.list |
| 8 |
mainfile:*a.c |
| 9 |
|
| 10 |
//--- b.list |
| 11 |
[address] |
| 12 |
mainfile:*a.c |
| 13 |
|
| 14 |
[alignment] |
| 15 |
mainfile:*.c |
| 16 |
|
| 17 |
//--- a.h |
| 18 |
int global_h; |
| 19 |
|
| 20 |
static inline int load(int *x) { |
| 21 |
return *x; |
| 22 |
} |
| 23 |
|
| 24 |
//--- a.c |
| 25 |
#include "a.h" |
| 26 |
|
| 27 |
int global_c; |
| 28 |
|
| 29 |
int foo(void *x) { |
| 30 |
return load(x); |
| 31 |
} |
| 32 |
|
| 33 |
// DEFAULT: @___asan_gen_{{.*}} = {{.*}} c"global_h\00" |
| 34 |
// DEFAULT: @___asan_gen_{{.*}} = {{.*}} c"global_c\00" |
| 35 |
// IGNORE-NOT: @___asan_gen_ |
| 36 |
|
| 37 |
// CHECK-LABEL: define {{.*}}@load( |
| 38 |
// DEFAULT: call void @__ubsan_handle_type_mismatch_v1_abort( |
| 39 |
// DEFAULT: call void @__asan_report_load4( |
| 40 |
// IGNORE-NOT: call void @__ubsan_handle_type_mismatch_v1_abort( |
| 41 |
// IGNORE-NOT: call void @__asan_report_load4( |