summaryrefslogtreecommitdiffstats
path: root/src/test/codegen/slice-reverse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/codegen/slice-reverse.rs')
-rw-r--r--src/test/codegen/slice-reverse.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/codegen/slice-reverse.rs b/src/test/codegen/slice-reverse.rs
new file mode 100644
index 000000000..e50b22f3a
--- /dev/null
+++ b/src/test/codegen/slice-reverse.rs
@@ -0,0 +1,27 @@
+// compile-flags: -O
+// only-x86_64
+// ignore-debug: the debug assertions in from_raw_parts get in the way
+
+#![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();
+}