| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ |
| 3 |
|
| 4 |
int global_1, global_2; |
| 5 |
|
| 6 |
__attribute__((__noclone__)) int g (int b, int c) |
| 7 |
{ |
| 8 |
global_1 = b; |
| 9 |
global_2 = c; |
| 10 |
} |
| 11 |
|
| 12 |
__attribute__((__noclone__)) int f (int a) |
| 13 |
{ |
| 14 |
/* Second parameter of g gets different values. */ |
| 15 |
if (a > 0) |
| 16 |
g (a, 3); |
| 17 |
else |
| 18 |
g (a, 5); |
| 19 |
} |
| 20 |
|
| 21 |
int main () |
| 22 |
{ |
| 23 |
f (7); |
| 24 |
return 0; |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
/* { dg-final { scan-ipa-dump-times "versioned function" 0 "cp" } } */ |