From 5ccada66a21e2fff8691b97189f127ecfd42ea26 Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Wed, 6 Mar 2024 19:36:09 -0500 Subject: [PATCH] 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. --- tests/codegen/common_prim_int_ptr.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/codegen/common_prim_int_ptr.rs b/tests/codegen/common_prim_int_ptr.rs index 9b798d495d4f..666ccc5a2cff 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> { // CHECK-LABEL: @extract_int #[no_mangle] pub unsafe fn extract_int(x: Result>) -> 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>) -> Box<()> { - // CHECK: start: - // CHECK-NEXT: ret ptr + // CHECK-NOT: ptrtoint + // CHECK-NOT: inttoptr + // CHECK-NOT: load + // CHECK-NOT: store x.unwrap_err_unchecked() }