about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-07-27 15:07:58 +0200
committerNikita Popov <npopov@redhat.com>2022-07-27 16:37:36 +0200
commit1433b2979b3b51b40df31f9bf5aeca5f31ea6685 (patch)
tree9a3cb61be4581577a3f450e793e4fb7fe815c00e /src
parente6f0e358d6fc811b02b9162d275217b5ac389ab6 (diff)
downloadrust-1433b2979b3b51b40df31f9bf5aeca5f31ea6685.tar.gz
rust-1433b2979b3b51b40df31f9bf5aeca5f31ea6685.zip
Make CFI tests opaque pointers compatible
Diffstat (limited to 'src')
-rw-r--r--src/test/codegen/sanitizer-cfi-emit-type-checks.rs7
-rw-r--r--src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs6
2 files changed, 6 insertions, 7 deletions
diff --git a/src/test/codegen/sanitizer-cfi-emit-type-checks.rs b/src/test/codegen/sanitizer-cfi-emit-type-checks.rs
index 082f0f121ff..8be5186de9e 100644
--- a/src/test/codegen/sanitizer-cfi-emit-type-checks.rs
+++ b/src/test/codegen/sanitizer-cfi-emit-type-checks.rs
@@ -8,11 +8,10 @@
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo{{.*}}!type !{{[0-9]+}}
     // CHECK:       start:
-    // CHECK-NEXT:  %0 = bitcast i32 (i32)* %f to i8*
-    // CHECK-NEXT:  %1 = call i1 @llvm.type.test(i8* %0, metadata !"{{[[:print:]]+}}")
-    // CHECK-NEXT:  br i1 %1, label %type_test.pass, label %type_test.fail
+    // CHECK:       [[TT:%.+]] = call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"{{[[:print:]]+}}")
+    // CHECK-NEXT:  br i1 [[TT]], label %type_test.pass, label %type_test.fail
     // CHECK:       type_test.pass:
-    // CHECK-NEXT:  %2 = call i32 %f(i32 %arg)
+    // CHECK-NEXT:  {{%.+}} = call i32 %f(i32 %arg)
     // CHECK-NEXT:  br label %bb1
     // CHECK:       type_test.fail:
     // CHECK-NEXT:  call void @llvm.trap()
diff --git a/src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs b/src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs
index 09310ba9f60..bafc4c6592f 100644
--- a/src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs
+++ b/src/test/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs
@@ -8,21 +8,21 @@
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
     // CHECK-SAME: {{.*}}!type ![[TYPE1:[0-9]+]]
-    // CHECK:       %1 = call i1 @llvm.type.test(i8* %0, metadata !"_ZTSFu3i32S_E")
+    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_E")
     f(arg)
 }
 
 pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}bar
     // CHECK-SAME: {{.*}}!type ![[TYPE2:[0-9]+]]
-    // CHECK:       %1 = call i1 @llvm.type.test(i8* %0, metadata !"_ZTSFu3i32S_S_E")
+    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E")
     f(arg1, arg2)
 }
 
 pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}baz
     // CHECK-SAME: {{.*}}!type ![[TYPE3:[0-9]+]]
-    // CHECK:       %1 = call i1 @llvm.type.test(i8* %0, metadata !"_ZTSFu3i32S_S_S_E")
+    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E")
     f(arg1, arg2, arg3)
 }