diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-03-06 14:28:11 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-03-17 21:51:52 +0200 |
| commit | bffb0decc870ee76783c5da956acc980e73939bf (patch) | |
| tree | 7441f2ad7859043e0386aa0bf9aa93a1e74d7d71 /src/test/codegen | |
| parent | 6c0674e613a708e25d9ae92de4ae4bc5756805c4 (diff) | |
| download | rust-bffb0decc870ee76783c5da956acc980e73939bf.tar.gz rust-bffb0decc870ee76783c5da956acc980e73939bf.zip | |
tests: Use arguments in codegen/stores.rs to turn aggregates into immediates.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/stores.rs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/test/codegen/stores.rs b/src/test/codegen/stores.rs index 5d2d47e1bf3..46e4c5f341b 100644 --- a/src/test/codegen/stores.rs +++ b/src/test/codegen/stores.rs @@ -23,25 +23,18 @@ pub struct Bytes { // The array is stored as i32, but its alignment is lower, go with 1 byte to avoid target // dependent alignment #[no_mangle] -pub fn small_array_alignment(x: &mut [i8; 4]) { -// CHECK: [[VAR:%[0-9]+]] = load {{(\[4 x i8\]\*, )?}}[4 x i8]** %x -// CHECK: [[VAR2:%[0-9]+]] = bitcast [4 x i8]* [[VAR]] to i32* -// CHECK: store i32 %{{.*}}, i32* [[VAR2]], align 1 - *x = [0; 4]; +pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) { +// CHECK: [[VAR:%[0-9]+]] = bitcast [4 x i8]* %y to i32* +// CHECK: store i32 %{{.*}}, i32* [[VAR]], align 1 + *x = y; } // CHECK-LABEL: small_struct_alignment // The struct is stored as i32, but its alignment is lower, go with 1 byte to avoid target // dependent alignment #[no_mangle] -pub fn small_struct_alignment(x: &mut Bytes) { -// CHECK: [[VAR:%[0-9]+]] = load {{(%Bytes\*, )?}}%Bytes** %x -// CHECK: [[VAR2:%[0-9]+]] = bitcast %Bytes* [[VAR]] to i32* -// CHECK: store i32 %{{.*}}, i32* [[VAR2]], align 1 - *x = Bytes { - a: 0, - b: 0, - c: 0, - d: 0, - }; +pub fn small_struct_alignment(x: &mut Bytes, y: Bytes) { +// CHECK: [[VAR:%[0-9]+]] = bitcast %Bytes* %y to i32* +// CHECK: store i32 %{{.*}}, i32* [[VAR]], align 1 + *x = y; } |
