* gcc.dg/20061124-1.c: Add exit() function prototype.
[official-gcc.git] / gcc / testsuite / gcc.dg / 20050603-2.c
blob363e3cdf35c27e82e22eea29f057b63250c9e7c3
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 #include <stdlib.h>
4 struct s {
5 unsigned short f: 16;
6 unsigned short y: 8;
7 unsigned short g: 2;
8 unsigned int x;
9 };
11 void set (struct s*, int) __attribute__((noinline));
12 void set (struct s* p, int flags) {
13 p->g = flags << 1;
15 main() {
16 struct s foo = {0 , 0, 3, 0};
17 set (&foo, -1);
18 if (foo.g != 2)
19 abort();
20 return 0;