[llvm-commits] [test-suite] r131107 - /test-suite/trunk/SingleSource/UnitTests/ms_struct_pack_layout-1.c
Fariborz Jahanian
fjahanian at apple.com
Mon May 9 15:19:23 PDT 2011
Author: fjahanian
Date: Mon May 9 17:19:23 2011
New Revision: 131107
URL: http://llvm.org/viewvc/llvm-project?rev=131107&view=rev
Log:
New test for packed ms_struct layout.
Added:
test-suite/trunk/SingleSource/UnitTests/ms_struct_pack_layout-1.c
Added: test-suite/trunk/SingleSource/UnitTests/ms_struct_pack_layout-1.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ms_struct_pack_layout-1.c?rev=131107&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/ms_struct_pack_layout-1.c (added)
+++ test-suite/trunk/SingleSource/UnitTests/ms_struct_pack_layout-1.c Mon May 9 17:19:23 2011
@@ -0,0 +1,20 @@
+extern void abort ();
+
+union u
+{
+ int a;
+} __attribute__((__ms_struct__, __packed__));
+
+struct s
+{
+ char c;
+ union u u;
+};
+
+int main (void)
+{
+ if (sizeof (struct s) != (sizeof (char) + sizeof (union u)))
+ abort ();
+
+ return 0;
+}
More information about the llvm-commits
mailing list