aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c
new file mode 100644
index 000000000..d62da2ad5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c
@@ -0,0 +1,40 @@
+/* bf-ms-attrib.c */
+/* Adapted from Donn Terry <donnte@microsoft.com> testcase
+ posted to GCC-patches
+ http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
+
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* } } */
+
+/* We don't want the default "pedantic-errors" in this case, since we're
+ testing nonstandard stuff to begin with. */
+/* { dg-options "-ansi" } */
+
+extern void abort(void);
+
+struct one_gcc {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+} __attribute__((__gcc_struct__)) ;
+
+
+struct one_ms {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+} __attribute__((__ms_struct__));
+
+
+main()
+ {
+ /* As long as the sizes are as expected, we know attributes are working.
+ bf-ms-layout.c makes sure the right thing happens when the attribute
+ is on. */
+ if (sizeof(struct one_ms) != 8)
+ abort();
+ if (sizeof(struct one_gcc) != 8)
+ abort();
+ return 0;
+ }