2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / bitfld-2.c
blob445879b14cc9948ad90aaf816fd832567b141871
1 /* Test whether bit field boundaries aren't advanced if bit field type
2 has alignment large enough. */
3 extern void abort (void);
4 extern void exit (int);
6 struct A {
7 unsigned short a : 5;
8 unsigned short b : 5;
9 unsigned short c : 6;
12 struct B {
13 unsigned short a : 5;
14 unsigned short b : 3;
15 unsigned short c : 8;
18 int main ()
20 /* If short is not at least 16 bits wide, don't test anything. */
21 if ((unsigned short) 65521 != 65521)
22 exit (0);
24 if (sizeof (struct A) != sizeof (struct B))
25 abort ();
27 exit (0);