Skip to content

Commit

Permalink
Update try_question_mark_nop.rs test
Browse files Browse the repository at this point in the history
  • Loading branch information
DianQK committed Sep 14, 2024
1 parent 93c8984 commit 4608269
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/codegen/try_question_mark_nop.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
//@ compile-flags: -O -Z merge-functions=disabled --edition=2021
//@ only-x86_64
// FIXME: Remove the `min-llvm-version`.
//@ min-llvm-version: 19

#![crate_type = "lib"]
#![feature(try_blocks)]

use std::ops::ControlFlow::{self, Break, Continue};
use std::ptr::NonNull;

// FIXME: The `trunc` and `select` instructions can be eliminated.
// CHECK-LABEL: @option_nop_match_32
#[no_mangle]
pub fn option_nop_match_32(x: Option<u32>) -> Option<u32> {
// CHECK: start:
// CHECK-NEXT: insertvalue { i32, i32 }
// CHECK-NEXT: [[TRUNC:%.*]] = trunc nuw i32 %0 to i1
// CHECK-NEXT: [[FIRST:%.*]] = select i1 [[TRUNC]], i32 %0
// CHECK-NEXT: insertvalue { i32, i32 } poison, i32 [[FIRST]]
// CHECK-NEXT: insertvalue { i32, i32 }
// CHECK-NEXT: ret { i32, i32 }
match x {
Expand Down

0 comments on commit 4608269

Please sign in to comment.