about summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2024-03-06 19:36:09 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2024-03-06 19:36:09 -0500
commit5ccada66a21e2fff8691b97189f127ecfd42ea26 (patch)
tree61a8f05e2af95099a6e6fa39db1fade1eaa20783
parent8e40b17b6bc57e9a905b263b79e254895252ea49 (diff)
downloadrust-5ccada66a21e2fff8691b97189f127ecfd42ea26.tar.gz
rust-5ccada66a21e2fff8691b97189f127ecfd42ea26.zip
make check lines for int/ptr common prim test more permissive
It seems that LLVM 17 doesn't fully optimize out unwrap_unchecked.

We can just loosen the check lines to account for this, since we don't
really care about the exact instructions, we just want to make sure that
inttoptr/ptrtoint aren't used for Box.
-rw-r--r--tests/codegen/common_prim_int_ptr.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/codegen/common_prim_int_ptr.rs b/tests/codegen/common_prim_int_ptr.rs
index 9b798d495d4..666ccc5a2cf 100644
--- a/tests/codegen/common_prim_int_ptr.rs
+++ b/tests/codegen/common_prim_int_ptr.rs
@@ -28,16 +28,16 @@ pub fn insert_box(x: Box<()>) -> Result<usize, Box<()>> {
 // CHECK-LABEL: @extract_int
 #[no_mangle]
 pub unsafe fn extract_int(x: Result<usize, Box<()>>) -> usize {
-    // CHECK: start:
-    // CHECK-NEXT: ptrtoint
-    // CHECK-NEXT: ret
+    // CHECK: ptrtoint
     x.unwrap_unchecked()
 }
 
 // CHECK-LABEL: @extract_box
 #[no_mangle]
 pub unsafe fn extract_box(x: Result<usize, Box<()>>) -> Box<()> {
-    // CHECK: start:
-    // CHECK-NEXT: ret ptr
+    // CHECK-NOT: ptrtoint
+    // CHECK-NOT: inttoptr
+    // CHECK-NOT: load
+    // CHECK-NOT: store
     x.unwrap_err_unchecked()
 }