mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 06:43:20 +03:00
add codegen test for #109328
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user