1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 /* { dg-skip-if "no stdlib.h in eBPF" { bpf-*-* } } */
4 #include <stdlib.h>
5 struct s {
6 unsigned short f: 16;
7 unsigned short y: 8;
8 unsigned short g: 2;
9 unsigned int x;
10 };
11
12 void set (struct s*, int) __attribute__((noinline));
13 void set (struct s* p, int flags) {
14 p->g = flags << 1;
15 }
16
17 int
18 main() {
19 struct s foo = {0 , 0, 3, 0};
20 set (&foo, -1);
21 if (foo.g != 2)
22 abort();
23 return 0;
24 }