add codegen test for #74938

This commit is contained in:
Lzu Tao 2024-05-20 21:20:33 +00:00
parent 2120ea5a91
commit bf178187c7

View File

@ -0,0 +1,15 @@
//@ compile-flags: -O
#![crate_type = "lib"]
const N: usize = 3;
pub type T = u8;
#[no_mangle]
// CHECK-LABEL: @split_mutiple
// CHECK-NOT: unreachable
pub fn split_mutiple(slice: &[T]) -> (&[T], &[T]) {
let len = slice.len() / N;
slice.split_at(len * N)
}