1 /* Test for MS bitfield layout */
2 /* { dg-do run { target *-*-mingw* *-*-cygwin* i?86-*-* x86_64-*-* } } */
8 char b
__attribute__ ((aligned (16)));
9 } __attribute__ ((ms_struct
));
15 } __attribute__ ((ms_struct
));
19 __extension__
char a
: 6;
20 char b
__attribute__ ((aligned (16)));
21 } __attribute__ ((ms_struct
));
25 __extension__
char a
: 6;
26 char b
__attribute__ ((aligned (2)));
27 } __attribute__ ((ms_struct
));
31 __extension__
char a
: 6;
32 char b
__attribute__ ((aligned (1)));
33 } __attribute__ ((ms_struct
));
37 static __PTRDIFF_TYPE__
offs (const void *a
, const void *b
)
39 return (__PTRDIFF_TYPE__
) ((const char*)a
- (const char*)b
);
44 if (offs (&s1
.b
, &s1
) != 16
45 || offs (&s2
.b
, &s2
) != 1
46 || offs (&s3
.b
, &s3
) != 16
47 || offs (&s4
.b
, &s4
) != 2
48 || offs (&s5
.b
, &s5
) != 1)