libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pta-ptrarith-1.c
bloba1dcf4f2ebde775bdf346dd3bd117a898ea8c064
1 /* { dg-do run } */
2 /* { dg-options "-fdump-tree-alias-details" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
5 struct Foo {
6 int *p;
7 };
9 struct Foo *ff;
11 void __attribute__((noinline))
12 foo (void *p)
14 struct Foo *f = (struct Foo *)p - 1;
15 *f->p = 0;
16 ff = f;
19 int bar (void)
21 struct Foo f;
22 int i = 1;
23 f.p = &i;
24 foo (&f + 1);
25 return i;
27 extern void abort (void);
28 int main()
30 if (bar () != 0)
31 abort ();
32 return 0;
35 /* { dg-final { scan-tree-dump "ESCAPED = {\[^\n\}\]* i f \[^\n\}\]*}" "alias" } } */