diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/print_type_sizes/packed.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/print_type_sizes/packed.rs')
-rw-r--r-- | src/test/ui/print_type_sizes/packed.rs | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/test/ui/print_type_sizes/packed.rs b/src/test/ui/print_type_sizes/packed.rs deleted file mode 100644 index 269cc3cc2..000000000 --- a/src/test/ui/print_type_sizes/packed.rs +++ /dev/null @@ -1,69 +0,0 @@ -// compile-flags: -Z print-type-sizes -// build-pass -// ignore-pass -// ^-- needed because `--pass check` does not emit the output needed. -// FIXME: consider using an attribute instead of side-effects. - -// This file illustrates how packing is handled; it should cause -// the elimination of padding that would normally be introduced -// to satisfy alignment desirata. -// -// It avoids using u64/i64 because on some targets that is only 4-byte -// aligned (while on most it is 8-byte aligned) and so the resulting -// padding and overall computed sizes can be quite different. - -#![allow(dead_code)] -#![feature(start)] - -#[derive(Default)] -#[repr(packed)] -struct Packed1 { - a: u8, - b: u8, - g: i32, - c: u8, - h: i16, - d: u8, -} - -#[derive(Default)] -#[repr(packed(2))] -struct Packed2 { - a: u8, - b: u8, - g: i32, - c: u8, - h: i16, - d: u8, -} - -#[derive(Default)] -#[repr(packed(2))] -#[repr(C)] -struct Packed2C { - a: u8, - b: u8, - g: i32, - c: u8, - h: i16, - d: u8, -} - -#[derive(Default)] -struct Padded { - a: u8, - b: u8, - g: i32, - c: u8, - h: i16, - d: u8, -} - -#[start] -fn start(_: isize, _: *const *const u8) -> isize { - let _c: Packed1 = Default::default(); - let _d: Packed2 = Default::default(); - let _e: Packed2C = Default::default(); - let _f: Padded = Default::default(); - 0 -} |