Merge with trank @ 137446
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr36373-3.c
blobd5ad93e1b9b7d799061282ab270b086e79602d89
1 /* { dg-do run } */
3 extern void abort (void);
4 struct Foo {
5 int *p;
6 };
7 struct Bar {
8 struct Foo *x;
9 int *q;
11 struct Foo __attribute__((noinline))
12 bar(int *p)
14 struct Foo f;
15 f.p = p;
16 return f;
18 void __attribute__((noinline))
19 foo(struct Foo f)
21 *f.p = 0;
23 int main()
25 int a, b;
26 a = 0;
27 b = 1;
28 struct Bar f;
29 struct Foo g = bar (&b);
30 f.x = &g;
31 f.q = &a;
32 foo(*f.x);
33 if (b != 0)
34 abort ();
35 return 0;