Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Represent Result<usize, Box<T>> as ScalarPair(i64, ptr) #121668

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/codegen/common_prim_int_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
scottmcm marked this conversation as resolved.
Show resolved Hide resolved

// 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()
}
scottmcm marked this conversation as resolved.
Show resolved Hide resolved
Loading