Skip to content

Commit 25d434b

Browse files
committed
Update try_question_mark_nop.rs test
1 parent c16c22c commit 25d434b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/codegen/try_question_mark_nop.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
//@ compile-flags: -O -Z merge-functions=disabled --edition=2021
22
//@ only-x86_64
3+
// FIXME: Remove the `min-llvm-version`.
4+
//@ min-llvm-version: 19
35

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

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

12+
// FIXME: The `trunc` and `select` instructions can be eliminated.
1013
// CHECK-LABEL: @option_nop_match_32
1114
#[no_mangle]
1215
pub fn option_nop_match_32(x: Option<u32>) -> Option<u32> {
1316
// CHECK: start:
14-
// CHECK-NEXT: insertvalue { i32, i32 }
17+
// CHECK-NEXT: [[TRUNC:%.*]] = trunc nuw i32 %0 to i1
18+
// CHECK-NEXT: [[FIRST:%.*]] = select i1 [[TRUNC]], i32 %0
19+
// CHECK-NEXT: insertvalue { i32, i32 } poison, i32 [[FIRST]]
1520
// CHECK-NEXT: insertvalue { i32, i32 }
1621
// CHECK-NEXT: ret { i32, i32 }
1722
match x {

0 commit comments

Comments
 (0)