2015-05-04 Sandra Loosemore <sandra@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr36373-2.c
blob2653182a52cf09f65f789dc818cc9c49be823719
1 /* { dg-do run } */
2 /* { dg-options "-fno-tree-sra" } */
4 extern void abort (void);
5 struct Foo {
6 int *p;
7 };
8 struct Bar {
9 struct Foo *x;
10 int *q;
12 struct Foo __attribute__((noinline))
13 bar(int *p)
15 struct Foo f;
16 f.p = p;
17 return f;
19 void __attribute__((noinline))
20 foo(struct Foo f)
22 *f.p = 0;
24 int main()
26 int a, b;
27 a = 0;
28 b = 1;
29 struct Bar f;
30 struct Foo g = bar (&b);
31 f.x = &g;
32 f.q = &a;
33 foo(*f.x);
34 if (b != 0)
35 abort ();
36 return 0;