about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-06-08 00:35:01 +0300
committerEduard Burtescu <edy.burt@gmail.com>2016-06-08 00:35:01 +0300
commite252865b744568649c3ecfcf8ac02bb6f73d7fc6 (patch)
treef6bc691c7a452e6aec460ec541fa91ce4aea8667 /src/test/codegen
parent9b2becaf6e20463253a80cbcb5ec2ecefb949d1e (diff)
downloadrust-e252865b744568649c3ecfcf8ac02bb6f73d7fc6.tar.gz
rust-e252865b744568649c3ecfcf8ac02bb6f73d7fc6.zip
trans: always use a memcpy for ABI argument/return casts.
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/stores.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/test/codegen/stores.rs b/src/test/codegen/stores.rs
index 8c425507975..89bb5d93c74 100644
--- a/src/test/codegen/stores.rs
+++ b/src/test/codegen/stores.rs
@@ -26,8 +26,12 @@ pub struct Bytes {
 #[no_mangle]
 #[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) {
-// CHECK: store i32 %{{.*}}, i32* %{{.*}}, align 1
-// CHECK: [[VAR:%[0-9]+]] = bitcast i32* %{{.*}} to [4 x i8]*
+// CHECK: %y = alloca [4 x i8]
+// CHECK: [[TMP:%.+]] = alloca i32
+// CHECK: store i32 %1, i32* [[TMP]]
+// CHECK: [[Y8:%[0-9]+]] = bitcast [4 x i8]* %y to i8*
+// CHECK: [[TMP8:%[0-9]+]] = bitcast i32* [[TMP]] to i8*
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* [[Y8]], i8* [[TMP8]], i{{[0-9]+}} 4, i32 1, i1 false)
     *x = y;
 }
 
@@ -37,7 +41,11 @@ pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) {
 #[no_mangle]
 #[rustc_no_mir] // FIXME #27840 MIR has different codegen.
 pub fn small_struct_alignment(x: &mut Bytes, y: Bytes) {
-// CHECK: store i32 %{{.*}}, i32* %{{.*}}, align 1
-// CHECK: [[VAR:%[0-9]+]] = bitcast i32* %{{.*}} to %Bytes*
+// CHECK: %y = alloca %Bytes
+// CHECK: [[TMP:%.+]] = alloca i32
+// CHECK: store i32 %1, i32* [[TMP]]
+// CHECK: [[Y8:%[0-9]+]] = bitcast %Bytes* %y to i8*
+// CHECK: [[TMP8:%[0-9]+]] = bitcast i32* [[TMP]] to i8*
+// CHECK: call void @llvm.memcpy.{{.*}}(i8* [[Y8]], i8* [[TMP8]], i{{[0-9]+}} 4, i32 1, i1 false)
     *x = y;
 }