From e252865b744568649c3ecfcf8ac02bb6f73d7fc6 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Wed, 8 Jun 2016 00:35:01 +0300 Subject: trans: always use a memcpy for ABI argument/return casts. --- src/test/codegen/stores.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/test/codegen') 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; } -- cgit 1.4.1-3-g733a5