summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/ipa-icf-2.C
blob: 9e780061270e2bc543d08883fd10a3ece7bb189c (plain)
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
37
38
39
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-icf"  } */

class A
{
public:
  __attribute__ ((noinline))
  int Foo2()
  {
    return 1;
  }

  int v;
  float f;
};

class B
{
public:
  __attribute__ ((noinline))
  int Bar2()
  {
    return 1;
  }

  int v;
  float f, aaa;
};

int main()
{
  A a;
  B b;

  return a.Foo2() + b.Bar2();
}

/* { dg-final { scan-ipa-dump "Semantic equality hit:" "icf"  } } */
/* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf"  } } */