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
5 // RUN: rm -f %t-vfsoverlay.yaml
6 // RUN: rm -f %t-nonexistent.ignorelist
7 // RUN: sed -e "s|@DIR@|%/T|g" %S/Inputs/sanitizer-ignorelist-vfsoverlay.yaml | sed -e "s|@REAL_FILE@|%/t-func.ignorelist|g" | sed -e "s|@NONEXISTENT_FILE@|%/t-nonexistent.ignorelist|g" > %t-vfsoverlay.yaml
8 // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-ignorelist=%/T/only-virtual-file.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
10 // RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-ignorelist=%/T/invalid-virtual-file.ignorelist -emit-llvm %s -o - 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=INVALID-MAPPED-FILE
11 // INVALID-MAPPED-FILE: invalid-virtual-file.ignorelist': [[MSG]]
13 // RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-ignorelist=%t-nonexistent.ignorelist -emit-llvm %s -o - 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=INVALID
14 // INVALID: nonexistent.ignorelist': [[MSG]]
22 // DEFAULT: call {{.*}}void @__ubsan
23 // FUNC-NOT: call {{.*}}void @__ubsan
24 // FILE-NOT: call {{.*}}void @__ubsan
32 // DEFAULT: call {{.*}}void @__ubsan
33 // FUNC: call {{.*}}void @__ubsan
34 // FILE-NOT: call {{.*}}void @__ubsan