summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr31136.c
blob: 66c202c8fd3b07aa807a10fcaa41f46fb8c0dcf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern void abort (void);

struct S {
  unsigned b4:4;
  unsigned b6:6;
} s;

int main()
{
  s.b6 = 31;
  s.b4 = s.b6;
  s.b6 = s.b4;
  if (s.b6 != 15)
    abort ();
  return 0;
}