PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipcp-agg-7.c
blob285eb2be02c6d53fe8bc93c428e6041aad138847
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
3 /* { dg-add-options bind_pic_locally } */
5 struct S
7 int a, b, c;
8 };
10 void *blah(int, void *);
12 static void __attribute__ ((noinline)) foo (int x, int z, struct S *p);
14 static void __attribute__ ((noinline))
15 bar (int x, int z, struct S *p)
17 foo (z, x, p);
20 static void __attribute__ ((noinline))
21 foo (int x, int z, struct S *p)
23 int i, c = p->c;
24 int b = p->b - z;
25 void *v = (void *) p;
27 if (z)
29 z--;
30 bar (z, x, p);
32 for (i = 0; i< c; i++)
33 v = blah(b + x + i, v);
36 void
37 entry (int c)
39 struct S s;
40 int i;
42 for (i = 0; i<c; i++)
44 s.a = c;
45 s.b = 64;
46 s.c = 32;
47 foo (4, i, &s);
50 /* { dg-final { scan-ipa-dump-times "Clone of bar" 1 "cp" } } */
51 /* { dg-final { scan-ipa-dump-times "Clone of foo" 1 "cp" } } */
52 /* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */