2018-06-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / bf-ms-attrib.c
blob2da4f0320d6a69a08e89d26173b448eee58a2d3c
1 /* bf-ms-attrib.c */
2 /* Adapted from Donn Terry <donnte@microsoft.com> testcase
3 posted to GCC-patches
4 http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
6 /* { dg-do run { target *-*-mingw* *-*-cygwin* } } */
8 /* We don't want the default "pedantic-errors" in this case, since we're
9 testing nonstandard stuff to begin with. */
10 /* { dg-options "-ansi" } */
12 extern void abort(void);
14 struct one_gcc {
15 int d;
16 unsigned char a;
17 unsigned short b:7;
18 char c;
19 } __attribute__((__gcc_struct__)) ;
22 struct one_ms {
23 int d;
24 unsigned char a;
25 unsigned short b:7;
26 char c;
27 } __attribute__((__ms_struct__));
30 main()
32 /* As long as the sizes are as expected, we know attributes are working.
33 bf-ms-layout.c makes sure the right thing happens when the attribute
34 is on. */
35 if (sizeof(struct one_ms) != 8)
36 abort();
37 if (sizeof(struct one_gcc) != 8)
38 abort();
39 return 0;