File: ipa-icf-37.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A8-2019-q3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 571,828 kB
  • sloc: ansic: 2,937,651; cpp: 881,644; ada: 597,189; makefile: 65,528; asm: 56,499; xml: 46,621; exp: 24,747; sh: 19,684; python: 7,256; pascal: 4,370; awk: 3,497; perl: 2,695; yacc: 316; ml: 285; f90: 234; lex: 198; objc: 194; haskell: 119
file content (36 lines) | stat: -rw-r--r-- 1,050 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-icf"  } */
static int a;
static int b;
static const int c = 2;
static const int d = 2;
static char * e = "test";
static char * f = "test";
static int g[3]={1,2,3};
static int h[3]={1,2,3};
static const int *i=&c;
static const int *j=&c;
static const int *k=&d;
int t(int tt)
{
  switch (tt)
  {
    case 1: return a;
    case 2: return b;
    case 3: return c;
    case 4: return d;
    case 5: return e[1];
    case 6: return f[1];
    case 7: return g[1];
    case 8: return h[1];
    case 9: return i[0];
    case 10: return j[0];
    case 11: return k[0];
  }
}
/* { dg-final { scan-ipa-dump "Equal symbols: 5" "icf"  } } */
/* { dg-final { scan-ipa-dump "Semantic equality hit:a->b" "icf"  } } */
/* { dg-final { scan-ipa-dump "Semantic equality hit:c->d" "icf"  } } */
/* { dg-final { scan-ipa-dump "Semantic equality hit:e->f" "icf"  } } */
/* { dg-final { scan-ipa-dump "Semantic equality hit:g->h" "icf"  } } */
/* { dg-final { scan-ipa-dump "Semantic equality hit:i->j" "icf"  } } */