[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / ubsan-ignorelist.c
blob409cb18a3179dc8bc835842105d84ce7c9a8eb10
1 // Verify ubsan doesn't emit checks for ignorelisted functions and files
2 // RUN: echo "fun:hash" > %t-func.ignorelist
3 // RUN: echo "src:%s" | sed -e 's/\\/\\\\/g' > %t-file.ignorelist
4 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -emit-llvm %s -o - | FileCheck %s --check-prefix=DEFAULT
5 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-ignorelist=%t-func.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
6 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-ignorelist=%t-file.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=FILE
8 unsigned i;
10 // DEFAULT: @hash
11 // FUNC: @hash
12 // FILE: @hash
13 unsigned hash(void) {
14 // DEFAULT: call {{.*}}void @__ubsan
15 // FUNC-NOT: call {{.*}}void @__ubsan
16 // FILE-NOT: call {{.*}}void @__ubsan
17 return i * 37;
20 // DEFAULT: @add
21 // FUNC: @add
22 // FILE: @add
23 unsigned add(void) {
24 // DEFAULT: call {{.*}}void @__ubsan
25 // FUNC: call {{.*}}void @__ubsan
26 // FILE-NOT: call {{.*}}void @__ubsan
27 return i + 1;