[llvm-commits] [test-suite] r133058 - /test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c
Jay Foad
jay.foad at gmail.com
Wed Jun 15 07:41:19 PDT 2011
Author: foad
Date: Wed Jun 15 09:41:19 2011
New Revision: 133058
URL: http://llvm.org/viewvc/llvm-project?rev=133058&view=rev
Log:
GCC only implements #pragma ms_struct on Darwin, so don't try to test it
on other platforms.
Modified:
test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c
Modified: test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c?rev=133058&r1=133057&r2=133058&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/ms_struct-bitfield-init-1.c Wed Jun 15 09:41:19 2011
@@ -2,6 +2,9 @@
#define ATTR __attribute__((__ms_struct__))
+// GCC only implements #pragma ms_struct on Darwin.
+#define HAVE_PRAGMA_MS_STRUCT (defined(__clang__) || defined(__MACH__))
+
struct {
unsigned int bf_1 : 12;
unsigned int : 0;
@@ -17,6 +20,7 @@
} ATTR t2 = {3,4};
static int a2[(sizeof(t2) == 4) -1];
+#if HAVE_PRAGMA_MS_STRUCT
#pragma ms_struct on
struct
{
@@ -26,6 +30,7 @@
} t3 = {5,6};
#pragma ms_struct off
static int a3[(sizeof(t3) == 4) -1];
+#endif
struct
{
@@ -85,8 +90,10 @@
abort();
if (t2.foo != 3 || t2.bar != 4)
abort();
+#if HAVE_PRAGMA_MS_STRUCT
if (t3.foo != 5 || t3.bar != 6)
abort();
+#endif
if (t5.foo != 7 || t5.bar != 8)
abort();
if (t6.foo != 5 || t6.bar != 10)
More information about the llvm-commits
mailing list