summaryrefslogtreecommitdiffstats
path: root/src/test/ui/packed/packed-struct-size-xc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/packed/packed-struct-size-xc.rs')
-rw-r--r--src/test/ui/packed/packed-struct-size-xc.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/packed/packed-struct-size-xc.rs b/src/test/ui/packed/packed-struct-size-xc.rs
new file mode 100644
index 000000000..46112d51d
--- /dev/null
+++ b/src/test/ui/packed/packed-struct-size-xc.rs
@@ -0,0 +1,20 @@
+// run-pass
+// aux-build:packed.rs
+
+
+extern crate packed;
+
+use std::mem;
+
+macro_rules! check {
+ ($t:ty, $align:expr, $size:expr) => ({
+ assert_eq!(mem::align_of::<$t>(), $align);
+ assert_eq!(mem::size_of::<$t>(), $size);
+ });
+}
+
+pub fn main() {
+ check!(packed::P1S5, 1, 5);
+ check!(packed::P2S6, 2, 6);
+ check!(packed::P2CS8, 2, 8);
+}