diff options
| author | Colin Pronovost <colin.pron@live.com> | 2018-09-24 23:09:44 -0400 |
|---|---|---|
| committer | Colin Pronovost <colin.pron@live.com> | 2018-09-24 23:09:44 -0400 |
| commit | 06b8c3ee5b52dc849259655578afca70cb32dda3 (patch) | |
| tree | 4107dfbb872b7d7f20c46b46ff29e224521359c0 /src/test/codegen/align-struct.rs | |
| parent | 70073ec61d0d56bca45b9bd40659bb75799cd273 (diff) | |
| download | rust-06b8c3ee5b52dc849259655578afca70cb32dda3.tar.gz rust-06b8c3ee5b52dc849259655578afca70cb32dda3.zip | |
Rely only on base alignment and offset for computing field alignment
Fix #54028
Diffstat (limited to 'src/test/codegen/align-struct.rs')
| -rw-r--r-- | src/test/codegen/align-struct.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/codegen/align-struct.rs b/src/test/codegen/align-struct.rs index bf119da2e82..887c43c6761 100644 --- a/src/test/codegen/align-struct.rs +++ b/src/test/codegen/align-struct.rs @@ -48,6 +48,16 @@ pub fn align64(i : i32) -> Align64 { a64 } +// For issue 54028: make sure that we are specifying the correct alignment for fields of aligned +// structs +// CHECK-LABEL: @align64_load +#[no_mangle] +pub fn align64_load(a: Align64) -> i32 { +// CHECK: [[FIELD:%.*]] = bitcast %Align64* %{{.*}} to i32* +// CHECK: {{%.*}} = load i32, i32* [[FIELD]], align 64 + a.0 +} + // CHECK-LABEL: @nested64 #[no_mangle] pub fn nested64(a: Align64, b: i32, c: i32, d: i8) -> Nested64 { |
