PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipcp-agg-4.c
blob5b0d691665429ed7323ee0ad6e53c6daddb3411e
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))
13 foo (struct S *p)
15 int i, c = p->c;
16 int b = p->b;
17 void *v = (void *) p;
19 for (i= 0; i< c; i++)
20 v = blah(b + i, v);
24 void
25 entry1 (int c)
27 struct S s;
28 int i;
30 for (i = 0; i<c; i++)
32 s.a = 1;
33 s.b = 64;
34 s.c = 32;
35 foo (&s);
37 s.c = 2;
38 foo (&s);
41 void
42 entry2 (int c)
44 struct S s;
45 int i;
47 for (i = 0; i<c; i++)
49 s.a = 6;
50 s.b = 64;
51 s.c = 32;
52 foo (&s);
54 s.c = 2;
55 foo (&s);
58 /* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo/\[0-9\]*\\." 2 "cp" } } */
59 /* { dg-final { scan-ipa-dump-times "Aggregate replacements:" 4 "cp" } } */
60 /* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */