Skip to content

Commit a4090d2

Browse files
committed
Add test for issue #27130
1 parent 1799d31 commit a4090d2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/test/codegen/issue-27130.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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[1..];
21+
}
22+
}

0 commit comments

Comments
 (0)