Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / sanitizer-special-case-list.c
blob55a69ebcfa414059195694396b796dda7f5aefaa
1 // Verify that ignorelist sections correctly select sanitizers to apply ignorelist entries to.
2 //
3 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow,cfi-icall -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list.unsanitized1.txt -emit-llvm %s -o - | FileCheck %s --check-prefix=UNSANITIZED
4 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow,cfi-icall -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list.unsanitized2.txt -emit-llvm %s -o - | FileCheck %s --check-prefix=UNSANITIZED
5 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow,cfi-icall -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list.unsanitized3.txt -emit-llvm %s -o - | FileCheck %s --check-prefix=UNSANITIZED
6 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow,cfi-icall -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list.unsanitized4.txt -emit-llvm %s -o - | FileCheck %s --check-prefix=UNSANITIZED
7 //
8 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow,cfi-icall -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list.sanitized.txt -emit-llvm %s -o - | FileCheck %s --check-prefix=SANITIZED
10 unsigned i;
12 // SANITIZED: @overflow
13 // UNSANITIZED: @overflow
14 unsigned overflow(void) {
15 // SANITIZED: call {{.*}}void @__ubsan
16 // UNSANITIZED-NOT: call {{.*}}void @__ubsan
17 return i * 37;
20 // SANITIZED: @cfi
21 // UNSANITIZED: @cfi
22 void cfi(void (*fp)(void)) {
23 // SANITIZED: llvm.type.test
24 // UNSANITIZED-NOT: llvm.type.test
25 fp();