PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / vrp6.c
blob971db44344207576426f91fa92f4941306063f8f
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 nonnull for 0" "cp" } } */
34 /* { dg-final { scan-tree-dump-times "if" 1 "vrp1" } } */