Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / sanitize-ignorelist-mainfile.c
blob84d58b4c018e3a277c65231be0a3aade7fe55d77
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
7 //--- a.list
8 mainfile:*a.c
10 //--- b.list
11 [address]
12 mainfile:*a.c
14 [alignment]
15 mainfile:*.c
17 //--- a.h
18 int global_h;
20 static inline int load(int *x) {
21 return *x;
24 //--- a.c
25 #include "a.h"
27 int global_c;
29 int foo(void *x) {
30 return load(x);
33 // DEFAULT: @___asan_gen_{{.*}} = {{.*}} c"global_h\00"
34 // DEFAULT: @___asan_gen_{{.*}} = {{.*}} c"global_c\00"
35 // IGNORE-NOT: @___asan_gen_
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(