2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr33136-1.c
blobd07c97eb7e94b591d52cac764a82c80005317ff8
1 /* PR tree-optimization/33136 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
5 extern void abort (void);
7 struct S
9 struct S *a;
10 int b;
11 float f;
14 static struct S s;
16 static int *
17 __attribute__((noinline, const))
18 foo (void)
20 return &s.b;
23 float
24 __attribute__((noinline))
25 bar (float *f)
27 s.f = 1.0;
28 *f = 4.0;
29 return s.f;
32 int
33 __attribute__((noinline))
34 baz (int *x)
36 s.b = 1;
37 *x = 4;
38 return s.b;
41 int
42 t (void)
44 float f = 8.0;
45 return bar (&f) + baz (foo ());
48 int
49 main (void)
51 if (t () != 5)
52 abort ();
53 return 0;