re PR middle-end/45644 (450.soplex in SPEC CPU 2006 is miscompiled)
[platform/upstream/gcc.git] / gcc / testsuite / gcc.dg / ipa / pr45644.c
1 /* Verify that we do not IPA-SRA bitfields.  */
2 /* { dg-do run } */
3 /* { dg-options "-O2"  } */
4
5 extern void abort (void);
6
7 struct S
8 {
9   int j : 8;
10   int i : 24;
11   int l;
12 };
13
14 static int __attribute__((noinline)) foo (struct S *s)
15 {
16   int z = s->i;
17   if (z != 777)
18     abort ();
19   return 0;
20 }
21
22 int __attribute__((noinline)) bar (struct S *s)
23 {
24   return foo (s);
25 }
26
27 int main (int argc, char *argv[])
28 {
29   struct S s;
30   s.j = 5;
31   s.i = 777;
32   s.l = -1;
33
34   return bar (&s);
35 }