PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-icf-39.c
blobaa7c28706d3721a6655079efa50640f6f55ed20f
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-icf -fmerge-all-constants -fdbg-cnt=merged_ipa_icf:1:3" } */
3 /* { dg-prune-output "dbg_cnt 'merged_ipa_icf' set to 1-3" } */
5 static int a;
6 static int b;
7 static const int c = 2;
8 static const int d = 2;
9 static char * e = "test";
10 static char * f = "test";
11 static int g[3]={1,2,3};
12 static int h[3]={1,2,3};
13 static const int *i=&c;
14 static const int *j=&c;
15 static const int *k=&d;
16 int t(int tt)
18 switch (tt)
20 case 1: return a;
21 case 2: return b;
22 case 3: return c;
23 case 4: return d;
24 case 5: return e[1];
25 case 6: return f[1];
26 case 7: return g[1];
27 case 8: return h[1];
28 case 9: return i[0];
29 case 10: return j[0];
30 case 11: return k[0];
33 /* { dg-final { scan-ipa-dump-times "Unified;" 2 "icf" } } */