2021-11-11 22:32:18 -06:00
|
|
|
//@ compile-flags: -O
|
|
|
|
//@ only-x86_64
|
2024-10-18 21:20:40 -05:00
|
|
|
//@ ignore-std-debug-assertions (debug assertions prevent generating shufflevector)
|
2021-11-11 22:32:18 -06:00
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
// CHECK-LABEL: @slice_reverse_u8
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn slice_reverse_u8(slice: &mut [u8]) {
|
|
|
|
// CHECK-NOT: panic_bounds_check
|
|
|
|
// CHECK-NOT: slice_end_index_len_fail
|
|
|
|
// CHECK: shufflevector <{{[0-9]+}} x i8>
|
|
|
|
// CHECK-NOT: panic_bounds_check
|
|
|
|
// CHECK-NOT: slice_end_index_len_fail
|
|
|
|
slice.reverse();
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @slice_reverse_i32
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn slice_reverse_i32(slice: &mut [i32]) {
|
|
|
|
// CHECK-NOT: panic_bounds_check
|
|
|
|
// CHECK-NOT: slice_end_index_len_fail
|
|
|
|
// CHECK: shufflevector <{{[0-9]+}} x i32>
|
|
|
|
// CHECK-NOT: panic_bounds_check
|
|
|
|
// CHECK-NOT: slice_end_index_len_fail
|
|
|
|
slice.reverse();
|
|
|
|
}
|