2024-05-20 14:52:30 -05:00
|
|
|
//@ compile-flags: -O
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
// CHECK-LABEL: @foo
|
2024-06-09 08:25:12 -05:00
|
|
|
// CHECK-NEXT: {{.*}}:
|
|
|
|
// CHECK-NEXT: getelementptr inbounds
|
2024-06-11 02:45:16 -05:00
|
|
|
// CHECK-NEXT: load [[TYPE:i(32|64)]]
|
|
|
|
// CHECK-NEXT: icmp eq [[TYPE]]
|
2024-05-20 14:52:30 -05:00
|
|
|
// CHECK-NEXT: br i1
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn foo(input: &mut &[u64]) -> Option<u64> {
|
|
|
|
let (first, rest) = input.split_first()?;
|
|
|
|
*input = rest;
|
|
|
|
Some(*first)
|
|
|
|
}
|