* gcc.dg/const-elim-1.c: xfail for xtensa.
[official-gcc.git] / gcc / testsuite / gcc.dg / pack-test-4.c
blob27ae0cdcc77e5665c05d6662cfc41c21c6466955
1 /* PR c/11885
2 Bug: flag4 was allocated into the same byte as the other flags.
3 { dg-options "" }
4 { dg-do run } */
6 typedef unsigned char uint8_t;
8 typedef struct {
9 uint8_t flag1:2;
10 uint8_t flag2:1;
11 uint8_t flag3:1;
13 uint8_t flag4;
15 } __attribute__ ((packed)) MyType;
17 int main (void)
19 MyType a;
20 MyType *b = &a;
22 b->flag1 = 0;
23 b->flag2 = 0;
24 b->flag3 = 0;
26 b->flag4 = 0;
28 b->flag4++;
30 if (b->flag1 != 0)
31 abort ();