add codegen test for #109328
This commit is contained in:
parent
ddb94dbd16
commit
7d967ffa8d
1 changed files with 17 additions and 0 deletions
17
tests/codegen/issues/issue-109328-split_first.rs
Normal file
17
tests/codegen/issues/issue-109328-split_first.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
//@ compile-flags: -O
|
||||
//@ min-llvm-version: 17
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[no_mangle]
|
||||
// CHECK-LABEL: @foo
|
||||
// CHECK: getelementptr inbounds
|
||||
// CHECK-NEXT: load i64
|
||||
// CHECK-NEXT: icmp eq i64
|
||||
// CHECK-NEXT: br i1
|
||||
#[no_mangle]
|
||||
pub fn foo(input: &mut &[u64]) -> Option<u64> {
|
||||
let (first, rest) = input.split_first()?;
|
||||
*input = rest;
|
||||
Some(*first)
|
||||
}
|
Loading…
Add table
Reference in a new issue