Skip to content

Commit 2829c27

Browse files
authored
Rollup merge of #132777 - durin42:llvm-20-poison-prop, r=nikic
try_question_mark_nop: update test for LLVM 20 llvm/llvm-project@dd11636 changes the IR of this test in a way that I don't think is bad, but needs adjusting. r? `@nikic` `@rustbot` label: +llvm-main
2 parents 6e05afd + 8fcc020 commit 2829c27

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/codegen/try_question_mark_nop.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//@ compile-flags: -O -Z merge-functions=disabled --edition=2021
22
//@ only-x86_64
33
// FIXME: Remove the `min-llvm-version`.
4+
//@ revisions: NINETEEN TWENTY
5+
//@[NINETEEN] min-llvm-version: 19
6+
//@[NINETEEN] ignore-llvm-version: 20-99
7+
//@[TWENTY] min-llvm-version: 20
48
//@ min-llvm-version: 19
59

610
#![crate_type = "lib"]
@@ -13,8 +17,11 @@ use std::ptr::NonNull;
1317
#[no_mangle]
1418
pub fn option_nop_match_32(x: Option<u32>) -> Option<u32> {
1519
// CHECK: start:
20+
// TWENTY-NEXT: %trunc = trunc nuw i32 %0 to i1
21+
// TWENTY-NEXT: %.2 = select i1 %trunc, i32 %1, i32 undef
1622
// CHECK-NEXT: [[REG1:%.*]] = insertvalue { i32, i32 } poison, i32 %0, 0
17-
// CHECK-NEXT: [[REG2:%.*]] = insertvalue { i32, i32 } [[REG1]], i32 %1, 1
23+
// NINETEEN-NEXT: [[REG2:%.*]] = insertvalue { i32, i32 } [[REG1]], i32 %1, 1
24+
// TWENTY-NEXT: [[REG2:%.*]] = insertvalue { i32, i32 } [[REG1]], i32 %.2, 1
1825
// CHECK-NEXT: ret { i32, i32 } [[REG2]]
1926
match x {
2027
Some(x) => Some(x),
@@ -26,6 +33,8 @@ pub fn option_nop_match_32(x: Option<u32>) -> Option<u32> {
2633
#[no_mangle]
2734
pub fn option_nop_traits_32(x: Option<u32>) -> Option<u32> {
2835
// CHECK: start:
36+
// TWENTY-NEXT: %trunc = trunc nuw i32 %0 to i1
37+
// TWENTY-NEXT: %.1 = select i1 %trunc, i32 %1, i32 undef
2938
// CHECK-NEXT: insertvalue { i32, i32 }
3039
// CHECK-NEXT: insertvalue { i32, i32 }
3140
// CHECK-NEXT: ret { i32, i32 }

0 commit comments

Comments
 (0)