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