brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1009 B · 409cb18 Raw
29 lines · c
1// Verify ubsan doesn't emit checks for ignorelisted functions and files2// RUN: echo "fun:hash" > %t-func.ignorelist3// RUN: echo "src:%s" | sed -e 's/\\/\\\\/g' > %t-file.ignorelist4// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -emit-llvm %s -o - | FileCheck %s --check-prefix=DEFAULT5// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-ignorelist=%t-func.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC6// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-ignorelist=%t-file.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=FILE7 8unsigned i;9 10// DEFAULT: @hash11// FUNC: @hash12// FILE: @hash13unsigned hash(void) {14// DEFAULT: call {{.*}}void @__ubsan15// FUNC-NOT: call {{.*}}void @__ubsan16// FILE-NOT: call {{.*}}void @__ubsan17  return i * 37;18}19 20// DEFAULT: @add21// FUNC: @add22// FILE: @add23unsigned add(void) {24// DEFAULT: call {{.*}}void @__ubsan25// FUNC: call {{.*}}void @__ubsan26// FILE-NOT: call {{.*}}void @__ubsan27  return i + 1;28}29