1 /* { dg-options "-fstrict-volatile-bitfields" } */
2 /* { dg-do run } */
3
4 extern int puts(const char *);
5 extern void abort(void) __attribute__((noreturn));
6
7 typedef struct {
8 volatile unsigned short a:8, b:8;
9 } BitStruct;
10
11 BitStruct bits = {1, 2};
12
13 void check(int i, int j)
14 {
15 if (i != 1 || j != 2) puts("FAIL"), abort();
16 }
17
18 int main ()
19 {
20 check(bits.a, bits.b);
21
22 return 0;
23 }