[llvm-commits] [test-suite] r146415 - in /test-suite/trunk/SingleSource/UnitTests: Makefile ms_struct-bitfield-1.c
Fariborz Jahanian
fjahanian at apple.com
Mon Dec 12 13:31:39 PST 2011
Author: fjahanian
Date: Mon Dec 12 15:31:39 2011
New Revision: 146415
URL: http://llvm.org/viewvc/llvm-project?rev=146415&view=rev
Log:
Test for r146414 checked in clang.
This is for // rdar://10513599
Added:
test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-1.c
Modified:
test-suite/trunk/SingleSource/UnitTests/Makefile
Modified: test-suite/trunk/SingleSource/UnitTests/Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/Makefile?rev=146415&r1=146414&r2=146415&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/Makefile (original)
+++ test-suite/trunk/SingleSource/UnitTests/Makefile Mon Dec 12 15:31:39 2011
@@ -29,7 +29,7 @@
# The ms_struct tests only make sense on x86_64.
ifneq ($(ARCH),x86_64)
-PROGRAMS_TO_SKIP += ms_struct-bitfield-init-1 ms_struct-bitfield-init ms_struct-bitfield ms_struct_pack_layout-1 ms_struct_pack_layout
+PROGRAMS_TO_SKIP += ms_struct-bitfield-init-1 ms_struct-bitfield-init ms_struct-bitfield ms_struct_pack_layout-1 ms_struct_pack_layout ms_struct-bitfield-1
endif
PROGRAM_REQUIRED_TO_EXIT_OK := 1
Added: test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-1.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-1.c?rev=146415&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-1.c (added)
+++ test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-1.c Mon Dec 12 15:31:39 2011
@@ -0,0 +1,36 @@
+#include <stddef.h>
+extern void abort();
+
+#pragma ms_struct on
+
+typedef struct
+{
+void *pv;
+int l;
+} Foo;
+
+typedef struct
+{
+void *pv1;
+Foo foo;
+unsigned short fInited : 1;
+void *pv2;
+} PackOddity;
+
+#pragma ms_struct off
+
+int main(int argc, char *argv[])
+{
+#pragma unused(argc, argv)
+ int sizeof_packoddity = sizeof(PackOddity);
+ int offsetof_foo = offsetof(PackOddity, foo);
+ int offsetof_pv2 = offsetof(PackOddity, pv2);
+ if (sizeof_packoddity != 40)
+ abort();
+ if (offsetof_foo != 8)
+ abort();
+ if (offsetof_pv2 != 32)
+ abort();
+ return 0;
+}
+
More information about the llvm-commits
mailing list