Skip to content

Commit 5ccada6

Browse files
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.
1 parent 8e40b17 commit 5ccada6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/codegen/common_prim_int_ptr.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ pub fn insert_box(x: Box<()>) -> Result<usize, Box<()>> {
2828
// CHECK-LABEL: @extract_int
2929
#[no_mangle]
3030
pub unsafe fn extract_int(x: Result<usize, Box<()>>) -> usize {
31-
// CHECK: start:
32-
// CHECK-NEXT: ptrtoint
33-
// CHECK-NEXT: ret
31+
// CHECK: ptrtoint
3432
x.unwrap_unchecked()
3533
}
3634

3735
// CHECK-LABEL: @extract_box
3836
#[no_mangle]
3937
pub unsafe fn extract_box(x: Result<usize, Box<()>>) -> Box<()> {
40-
// CHECK: start:
41-
// CHECK-NEXT: ret ptr
38+
// CHECK-NOT: ptrtoint
39+
// CHECK-NOT: inttoptr
40+
// CHECK-NOT: load
41+
// CHECK-NOT: store
4242
x.unwrap_err_unchecked()
4343
}

0 commit comments

Comments
 (0)