1 /* { dg-do run } */
2 /* { dg-options "-fdump-tree-alias" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
4
5 struct Foo {
6 int *p;
7 };
8
9 struct Foo *ff;
10
11 void __attribute__((noinline))
12 foo (void *p)
13 {
14 struct Foo *f = (struct Foo *)p - 1;
15 *f->p = 0;
16 ff = f;
17 }
18
19 int bar (void)
20 {
21 struct Foo f;
22 int i = 1;
23 f.p = &i;
24 foo (&f + 1);
25 return i;
26 }
27 extern void abort (void);
28 int main()
29 {
30 if (bar () != 0)
31 abort ();
32 return 0;
33 }
34
35 /* { dg-final { scan-tree-dump "ESCAPED = {\[^\n\}\]* i f \[^\n\}\]*}" "alias" } } */