Skip to content

Commit 1433b29

Browse files
committed
Make CFI tests opaque pointers compatible
1 parent e6f0e35 commit 1433b29

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/test/codegen/sanitizer-cfi-emit-type-checks.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
99
// CHECK-LABEL: define{{.*}}foo{{.*}}!type !{{[0-9]+}}
1010
// CHECK: start:
11-
// CHECK-NEXT: %0 = bitcast i32 (i32)* %f to i8*
12-
// CHECK-NEXT: %1 = call i1 @llvm.type.test(i8* %0, metadata !"{{[[:print:]]+}}")
13-
// CHECK-NEXT: br i1 %1, label %type_test.pass, label %type_test.fail
11+
// CHECK: [[TT:%.+]] = call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"{{[[:print:]]+}}")
12+
// CHECK-NEXT: br i1 [[TT]], label %type_test.pass, label %type_test.fail
1413
// CHECK: type_test.pass:
15-
// CHECK-NEXT: %2 = call i32 %f(i32 %arg)
14+
// CHECK-NEXT: {{%.+}} = call i32 %f(i32 %arg)
1615
// CHECK-NEXT: br label %bb1
1716
// CHECK: type_test.fail:
1817
// CHECK-NEXT: call void @llvm.trap()

src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
99
// CHECK-LABEL: define{{.*}}foo
1010
// CHECK-SAME: {{.*}}!type ![[TYPE1:[0-9]+]]
11-
// CHECK: %1 = call i1 @llvm.type.test(i8* %0, metadata !"_ZTSFu3i32S_E")
11+
// CHECK: call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_E")
1212
f(arg)
1313
}
1414

1515
pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
1616
// CHECK-LABEL: define{{.*}}bar
1717
// CHECK-SAME: {{.*}}!type ![[TYPE2:[0-9]+]]
18-
// CHECK: %1 = call i1 @llvm.type.test(i8* %0, metadata !"_ZTSFu3i32S_S_E")
18+
// CHECK: call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E")
1919
f(arg1, arg2)
2020
}
2121

2222
pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
2323
// CHECK-LABEL: define{{.*}}baz
2424
// CHECK-SAME: {{.*}}!type ![[TYPE3:[0-9]+]]
25-
// CHECK: %1 = call i1 @llvm.type.test(i8* %0, metadata !"_ZTSFu3i32S_S_S_E")
25+
// CHECK: call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E")
2626
f(arg1, arg2, arg3)
2727
}
2828

0 commit comments

Comments
 (0)