Skip to content

Commit bf17818

Browse files
committed
add codegen test for rust-lang#74938
1 parent 2120ea5 commit bf17818

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ compile-flags: -O
2+
3+
#![crate_type = "lib"]
4+
5+
const N: usize = 3;
6+
pub type T = u8;
7+
8+
#[no_mangle]
9+
// CHECK-LABEL: @split_mutiple
10+
// CHECK-NOT: unreachable
11+
pub fn split_mutiple(slice: &[T]) -> (&[T], &[T]) {
12+
let len = slice.len() / N;
13+
slice.split_at(len * N)
14+
}
15+

0 commit comments

Comments
 (0)