|
| 1 | +// RUN: rm -rf %t |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
1 | 4 | // Verify ubsan doesn't emit checks for ignorelisted types
|
2 |
| -// RUN: echo "[{unsigned-integer-overflow,signed-integer-overflow}]" > %t-int.ignorelist |
3 |
| -// RUN: echo "type:int" >> %t-int.ignorelist |
4 |
| -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t-int.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=INT |
| 5 | +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t/int.ignorelist -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefix=INT |
| 6 | +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t/nosection.ignorelist -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefix=INT |
| 7 | +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t/allow-same-as-no-category.ignorelist -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefix=INT |
| 8 | +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t/myty.ignorelist -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefix=MYTY |
| 9 | +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=implicit-signed-integer-truncation,implicit-unsigned-integer-truncation -fsanitize-ignorelist=%t/trunc.ignorelist -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefix=TRUNC |
| 10 | + |
| 11 | +// Verify ubsan vptr does not check down-casts on ignorelisted types. |
| 12 | +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=vptr -fsanitize-recover=vptr -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefix=VPTR |
| 13 | +// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=vptr -fsanitize-recover=vptr -fsanitize-ignorelist=%t/vptr.ignorelist -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefix=VPTR-TYPE |
5 | 14 |
|
6 |
| -// RUN: echo "type:int" > %t-nosection.ignorelist |
7 |
| -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t-nosection.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=INT |
8 | 15 |
|
9 |
| -// RUN: echo "type:int=allow" > %t-allow-same-as-no-category.ignorelist |
10 |
| -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t-allow-same-as-no-category.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=INT |
| 16 | +//--- int.ignorelist |
| 17 | +[{unsigned-integer-overflow,signed-integer-overflow}] |
| 18 | +type:int |
11 | 19 |
|
12 |
| -// RUN: echo "[{unsigned-integer-overflow,signed-integer-overflow}]" > %t-myty.ignorelist |
13 |
| -// RUN: echo "type:*" >> %t-myty.ignorelist |
14 |
| -// RUN: echo "type:myty=skip" >> %t-myty.ignorelist |
15 |
| -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=signed-integer-overflow,unsigned-integer-overflow -fsanitize-ignorelist=%t-myty.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=MYTY |
| 20 | +//--- nosection.ignorelist |
| 21 | +type:int |
16 | 22 |
|
17 |
| -// RUN: echo "[{implicit-signed-integer-truncation,implicit-unsigned-integer-truncation}]" > %t-trunc.ignorelist |
18 |
| -// RUN: echo "type:char" >> %t-trunc.ignorelist |
19 |
| -// RUN: echo "type:unsigned char" >> %t-trunc.ignorelist |
20 |
| -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=implicit-signed-integer-truncation,implicit-unsigned-integer-truncation -fsanitize-ignorelist=%t-trunc.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=TRUNC |
| 23 | +//--- allow-same-as-no-category.ignorelist |
| 24 | +type:int=allow |
21 | 25 |
|
22 |
| -// Verify ubsan vptr does not check down-casts on ignorelisted types. |
23 |
| -// RUN: echo "type:_ZTI3Foo" > %t-type.ignorelist |
24 |
| -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=vptr -fsanitize-recover=vptr -emit-llvm %s -o - | FileCheck %s --check-prefix=VPTR |
25 |
| -// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsanitize=vptr -fsanitize-recover=vptr -fsanitize-ignorelist=%t-type.ignorelist -emit-llvm %s -o - | FileCheck %s --check-prefix=VPTR-TYPE |
| 26 | +//--- myty.ignorelist |
| 27 | +[{unsigned-integer-overflow,signed-integer-overflow}] |
| 28 | +type:* |
| 29 | +type:myty=skip |
| 30 | + |
| 31 | +//--- trunc.ignorelist |
| 32 | +[{implicit-signed-integer-truncation,implicit-unsigned-integer-truncation}] |
| 33 | +type:char |
| 34 | +type:unsigned char |
| 35 | + |
| 36 | + |
| 37 | +//--- vptr.ignorelist |
| 38 | +type:_ZTI3Foo |
26 | 39 |
|
| 40 | +//--- test.cpp |
27 | 41 | class Bar {
|
28 | 42 | public:
|
29 | 43 | virtual ~Bar() {}
|
|
0 commit comments