]> git.proxmox.com Git - rustc.git/blob - src/test/codegen/issue-27130.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / codegen / issue-27130.rs
1 // compile-flags: -O
2 // min-llvm-version: 11.0
3
4 #![crate_type = "lib"]
5
6 // CHECK-LABEL: @trim_in_place
7 #[no_mangle]
8 pub fn trim_in_place(a: &mut &[u8]) {
9 while a.first() == Some(&42) {
10 // CHECK-NOT: slice_index_order_fail
11 *a = &a[1..];
12 }
13 }
14
15 // CHECK-LABEL: @trim_in_place2
16 #[no_mangle]
17 pub fn trim_in_place2(a: &mut &[u8]) {
18 while let Some(&42) = a.first() {
19 // CHECK-NOT: slice_index_order_fail
20 *a = &a[2..];
21 }
22 }