| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-ipa-icf" } */ |
| 3 |
|
| 4 |
class A |
| 5 |
{ |
| 6 |
public: |
| 7 |
__attribute__ ((noinline)) |
| 8 |
virtual int Foo2() |
| 9 |
{ |
| 10 |
return v; |
| 11 |
} |
| 12 |
|
| 13 |
float f; |
| 14 |
int v; |
| 15 |
}; |
| 16 |
|
| 17 |
class B |
| 18 |
{ |
| 19 |
public: |
| 20 |
__attribute__ ((noinline)) |
| 21 |
int Bar2() |
| 22 |
{ |
| 23 |
return v; |
| 24 |
} |
| 25 |
|
| 26 |
float f, aaa; |
| 27 |
int v; |
| 28 |
}; |
| 29 |
|
| 30 |
int main() |
| 31 |
{ |
| 32 |
A a; |
| 33 |
B b; |
| 34 |
|
| 35 |
a.Foo2(); |
| 36 |
b.Bar2(); |
| 37 |
|
| 38 |
return 12345; |
| 39 |
} |
| 40 |
|
| 41 |
/* { dg-final { scan-ipa-dump-not "Semantic equality hit:" "icf" } } */ |
| 42 |
/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */ |