03dd1ec829018e00133dc96ee11ca5467ee54cc9
[cparser] / bitfield2.c
1 struct x {
2   unsigned x1:1;
3   unsigned x2:2;
4   unsigned x3:3;
5   unsigned x4:4;
6 };
7
8 void foobar (int x, int y, int z)
9 {
10   struct x a = {x, y, z, 7};
11   struct x b = {x, y, z, 3};
12   struct x *c = &b;
13
14   c->x3 += (a.x2 - a.x1) * c->x2;
15   if (a.x1 != 1 || c->x3 != 5)
16     abort ();
17   exit (0);
18 }
19
20 int main()
21 {
22   foobar (1, 2, 3);
23 }