This repository was archived by the owner on Apr 23, 2020. It is now read-only.
File tree 2 files changed +38
-11
lines changed
2 files changed +38
-11
lines changed Original file line number Diff line number Diff line change
1
+ // UNSUPPORTED: system-windows
2
+
3
+ // Verify ubsan doesn't emit checks for blacklisted functions and files
4
+ // RUN: echo "fun:hash" > %t-func.blacklist
5
+ // RUN: echo "src:%s" | sed -e 's/\\/\\\\/g' > %t-file.blacklist
6
+
7
+ // RUN: rm -f %t-vfsoverlay.yaml
8
+ // RUN: rm -f %t-nonexistent.blacklist
9
+ // RUN: sed -e "s|@DIR@|%/T|g" %S/Inputs/sanitizer-blacklist-vfsoverlay.yaml | sed -e "s|@REAL_FILE@|%/t-func.blacklist|g" | sed -e "s|@NONEXISTENT_FILE@|%/t-nonexistent.blacklist|g" > %t-vfsoverlay.yaml
10
+ // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%T/only-virtual-file.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
11
+
12
+ // RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%T/invalid-virtual-file.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID-MAPPED-FILE
13
+ // INVALID-MAPPED-FILE: invalid-virtual-file.blacklist': No such file or directory
14
+
15
+ // RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%t-nonexistent.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID
16
+ // INVALID: nonexistent.blacklist': No such file or directory
17
+
18
+ unsigned i ;
19
+
20
+ // DEFAULT: @hash
21
+ // FUNC: @hash
22
+ // FILE: @hash
23
+ unsigned hash () {
24
+ // DEFAULT: call {{.*}}void @__ubsan
25
+ // FUNC-NOT: call {{.*}}void @__ubsan
26
+ // FILE-NOT: call {{.*}}void @__ubsan
27
+ return i * 37 ;
28
+ }
29
+
30
+ // DEFAULT: @add
31
+ // FUNC: @add
32
+ // FILE: @add
33
+ unsigned add () {
34
+ // DEFAULT: call {{.*}}void @__ubsan
35
+ // FUNC: call {{.*}}void @__ubsan
36
+ // FILE-NOT: call {{.*}}void @__ubsan
37
+ return i + 1 ;
38
+ }
Original file line number Diff line number Diff line change 5
5
// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-blacklist=%t-func.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
6
6
// RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -fsanitize-blacklist=%t-file.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FILE
7
7
8
- // RUN: rm -f %t-vfsoverlay.yaml
9
- // RUN: rm -f %t-nonexistent.blacklist
10
- // RUN: sed -e "s|@DIR@|%/T|g" %S/Inputs/sanitizer-blacklist-vfsoverlay.yaml | sed -e "s|@REAL_FILE@|%/t-func.blacklist|g" | sed -e "s|@NONEXISTENT_FILE@|%/t-nonexistent.blacklist|g" > %t-vfsoverlay.yaml
11
- // RUN: %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%T/only-virtual-file.blacklist -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC
12
-
13
- // RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%T/invalid-virtual-file.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID-MAPPED-FILE
14
- // INVALID-MAPPED-FILE: invalid-virtual-file.blacklist': No such file or directory
15
-
16
- // RUN: not %clang_cc1 -fsanitize=unsigned-integer-overflow -ivfsoverlay %t-vfsoverlay.yaml -fsanitize-blacklist=%t-nonexistent.blacklist -emit-llvm %s -o - 2>&1 | FileCheck %s --check-prefix=INVALID
17
- // INVALID: nonexistent.blacklist': No such file or directory
18
-
19
8
unsigned i ;
20
9
21
10
// DEFAULT: @hash
You can’t perform that action at this time.
0 commit comments