aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr91126.c
blob: 8e34815b9a78709d385b108d04e22ea125d51432 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do run } */

struct S
{
  __INT32_TYPE__ a : 24;
  __INT32_TYPE__ b : 8;
} s;

int
main()
{
  s.a = 0xfefefe;
  s.b = 0xfe;
  unsigned char c;
  c = ((unsigned char *)&s)[0];
  if (c != 0xfe)
    __builtin_abort ();
  c = ((unsigned char *)&s)[1];
  if (c != 0xfe)
    __builtin_abort ();
  c = ((unsigned char *)&s)[2];
  if (c != 0xfe)
    __builtin_abort ();
  c = ((unsigned char *)&s)[3];
  if (c != 0xfe)
    __builtin_abort ();
  return 0;
}