PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipcp-agg-8.c
bloba2a870d2e1a0c1d48010e72ac3526ecfa09c2e11
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-ipa-sra -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 p->b = 0;
18 foo (z, x, p);
21 static void __attribute__ ((noinline))
22 foo (int x, int z, struct S *p)
24 int i, c = p->c;
25 int b = p->b - z;
26 void *v = (void *) p;
28 if (z)
30 z--;
31 bar (z, x, p);
33 for (i = 0; i< c; i++)
34 v = blah(b + x + i, v);
37 void
38 entry (int c)
40 struct S s;
41 int i;
43 for (i = 0; i<c; i++)
45 s.a = c;
46 s.b = 64;
47 s.c = 32;
48 foo (4, i, &s);
51 /* { dg-final { scan-tree-dump "->b;" "optimized" } } */