summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/pr45644.c
blob: 3f61b8b41273a08b4d2993a59ee0acefb4586825 (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
29
30
31
32
33
34
35
/* Verify that we do not IPA-SRA bitfields.  */
/* { dg-do run } */
/* { dg-options "-O2"  } */

extern void abort (void);

struct S
{
  int j : 8;
  int i : 24;
  int l;
};

static int __attribute__((noinline)) foo (struct S *s)
{
  int z = s->i;
  if (z != 777)
    abort ();
  return 0;
}

int __attribute__((noinline)) bar (struct S *s)
{
  return foo (s);
}

int main (int argc, char *argv[])
{
  struct S s;
  s.j = 5;
  s.i = 777;
  s.l = -1;

  return bar (&s);
}