PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-icf-2.c
blob983e3d818d0c3d4da1886f019dac21d3e5741c2e
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-icf" } */
4 #include <stdio.h>
6 struct container
8 int x;
9 int y;
12 static struct container max;
13 static int pole[3][3];
14 static int pole2[123];
16 static struct container superpole[10][10];
18 void f1(struct container *c)
20 struct container pes;
21 pes.x = 123;
22 pes.y = 123;
24 struct container *pesp = c;
25 pesp->x = 5;
27 pole[1][2] = 3;
29 superpole[4][3].x = 4;
30 max.x = 3;
31 void *x = &pole;
33 int **a = (int**)pole;
34 a[1][2] = 543;
36 if(x != 0)
37 pole[1][2] = 123;
40 void f2(struct container *c)
42 struct container pes;
43 pes.x = 123;
44 pes.y = 123;
46 struct container *pesp = c;
47 pesp->x = 5;
49 pole[1][2] = 3;
51 superpole[4][3].x = 4;
52 max.x = 3;
53 void *x = &pole;
55 int **a = (int**)pole;
56 a[1][2] = 543;
58 if(x != 0)
59 pole[1][2] = 123;
62 int main(int argc, char **argv)
64 return 0;
67 /* { dg-final { scan-ipa-dump "Semantic equality hit:f1->f2" "icf" } } */
68 /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */