summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/volatile-bitfields-2.c
blob: a57cd74753cbcc5e0c463a8329a38d371d818d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do run } */
/* { dg-options "-fstrict-volatile-bitfields" } */

extern void abort(void);
struct thing {
  volatile unsigned short a: 8;
  volatile unsigned short b: 8;
} t = {1,2};

int main()
{
  t.a = 3;
  if (t.a !=3 || t.b !=2) abort();
  return 0;
}