diff options
| author | DianQK <dianqk@dianqk.net> | 2024-09-03 20:38:27 +0800 |
|---|---|---|
| committer | DianQK <dianqk@dianqk.net> | 2024-09-14 13:30:36 +0800 |
| commit | 25d434b254bf45347210095600c0a47f65bcaa54 (patch) | |
| tree | 997218f884bcc47a203fb39468a8a28cb6853b69 | |
| parent | c16c22cc9c4daf4485c78e789c6e2a4bedea83b4 (diff) | |
| download | rust-25d434b254bf45347210095600c0a47f65bcaa54.tar.gz rust-25d434b254bf45347210095600c0a47f65bcaa54.zip | |
Update try_question_mark_nop.rs test
| -rw-r--r-- | tests/codegen/try_question_mark_nop.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/codegen/try_question_mark_nop.rs b/tests/codegen/try_question_mark_nop.rs index c23f41f5467..321067d1b90 100644 --- a/tests/codegen/try_question_mark_nop.rs +++ b/tests/codegen/try_question_mark_nop.rs @@ -1,5 +1,7 @@ //@ 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)] @@ -7,11 +9,14 @@ 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 { |
