2024-05-20 16:20:33 -05:00
|
|
|
//@ compile-flags: -O
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
const N: usize = 3;
|
|
|
|
pub type T = u8;
|
|
|
|
|
2024-06-09 08:25:12 -05:00
|
|
|
// CHECK-LABEL: @split_multiple
|
2024-05-20 16:20:33 -05:00
|
|
|
// CHECK-NOT: unreachable
|
2024-06-09 08:25:12 -05:00
|
|
|
#[no_mangle]
|
|
|
|
pub fn split_multiple(slice: &[T]) -> (&[T], &[T]) {
|
2024-05-20 16:20:33 -05:00
|
|
|
let len = slice.len() / N;
|
|
|
|
slice.split_at(len * N)
|
|
|
|
}
|