about summary refs log tree commit diff
path: root/tests/ui/packed/packed-struct-size-xc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/packed/packed-struct-size-xc.rs')
-rw-r--r--tests/ui/packed/packed-struct-size-xc.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/packed/packed-struct-size-xc.rs b/tests/ui/packed/packed-struct-size-xc.rs
new file mode 100644
index 00000000000..46112d51d83
--- /dev/null
+++ b/tests/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);
+}