libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / vrp6.c
blob03e7ab933636b9770599a6efd951d171a071b8d9
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-cp-details -fdump-tree-vrp1" } */
4 static __attribute__((noinline, noclone))
5 int foo (int *p)
7 if (!p)
8 return 0;
9 *p = 1;
12 struct st
14 int a;
15 int b;
18 struct st s2;
19 int a;
20 int bar (struct st *s)
22 struct st s3;
23 int b;
24 if (!s)
25 return 0;
26 foo (&s->a);
27 foo (&s2.a);
28 foo (&s3.a);
29 foo (&a);
30 foo (&b);
33 /* { dg-final { scan-ipa-dump "Setting value range.* \\\[1, \\+INF\\\]" "cp" } } */
34 /* { dg-final { scan-tree-dump-times "if" 1 "vrp1" } } */