Skip to content

Commit ce2a808

Browse files
committed
use split-file for tests
Signed-off-by: Justin Stitt <[email protected]>
1 parent 21be60a commit ce2a808

File tree

1 file changed

+33
-19
lines changed

1 file changed

+33
-19
lines changed

clang/test/CodeGen/ubsan-type-ignorelist.cpp renamed to clang/test/CodeGen/ubsan-type-ignorelist.test

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,43 @@
1+
// RUN: rm -rf %t
2+
// RUN: split-file %s %t
3+
14
// 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
514

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
815

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
1119

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
1622

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
2125

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
2639

40+
//--- test.cpp
2741
class Bar {
2842
public:
2943
virtual ~Bar() {}

0 commit comments

Comments
 (0)