Skip to content
/ rustc Public
forked from rust-lang/rust

Commit

Permalink
add codegen test for rust-lang#74938
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jun 9, 2024
1 parent 2120ea5 commit bf17818
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/codegen/issues/issue-74938-array-split-at.rs
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit bf17818

Please sign in to comment.