1/* { dg-do compile } */
2/* { dg-options "-O2 -fdump-ipa-icf"  } */
3
4#include <stdio.h>
5
6struct container
7{
8  int x;
9  int y;
10};
11
12static struct container max;
13static int pole[3][3];
14static int pole2[123];
15
16static struct container superpole[10][10];
17
18void f1(struct container *c)
19{
20  struct container pes;
21  pes.x = 123;
22  pes.y = 123;
23
24  struct container *pesp = c;
25  pesp->x = 5;
26
27  pole[1][2] = 3;
28
29  superpole[4][3].x = 4;
30  max.x = 3;
31  void *x = &pole;
32
33  int **a = (int**)pole;
34  a[1][2] = 543;
35
36  if(x != 0)
37    pole[1][2] = 123;
38}
39
40void f2(struct container *c)
41{
42  struct container pes;
43  pes.x = 123;
44  pes.y = 123;
45
46  struct container *pesp = c;
47  pesp->x = 5;
48
49  pole[1][2] = 3;
50
51  superpole[4][3].x = 4;
52  max.x = 3;
53  void *x = &pole;
54
55  int **a = (int**)pole;
56  a[1][2] = 543;
57
58  if(x != 0)
59    pole[1][2] = 123;
60}
61
62int main(int argc, char **argv)
63{
64  return 0;
65}
66
67/* { dg-final { scan-ipa-dump "Semantic equality hit:f2->f1" "icf"  } } */
68/* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf"  } } */
69/* { dg-final { cleanup-ipa-dump "icf" } } */
70