| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-ipa-cp-details" } */ |
| 3 |
|
| 4 |
static __attribute__((noinline, noclone)) |
| 5 |
int foo (int i) |
| 6 |
{ |
| 7 |
if (i < 5) |
| 8 |
__builtin_abort (); |
| 9 |
return 0; |
| 10 |
} |
| 11 |
|
| 12 |
static __attribute__((noinline, noclone)) |
| 13 |
int bar (int j) |
| 14 |
{ |
| 15 |
if (j > 8) |
| 16 |
return foo (j + 2); |
| 17 |
else if (j > 2) |
| 18 |
return foo (j + 3); |
| 19 |
|
| 20 |
return 0; |
| 21 |
} |
| 22 |
|
| 23 |
int main () |
| 24 |
{ |
| 25 |
for (unsigned int i =0; i < 1000; ++i) |
| 26 |
bar (i); |
| 27 |
|
| 28 |
return 0; |
| 29 |
} |
| 30 |
|
| 31 |
/* { dg-final { scan-ipa-dump "Setting value range of param 0 \\(now 0\\).* \\\[6," "cp" } } */ |
| 32 |
/* { dg-final { scan-ipa-dump "Setting value range of param 0 \\(now 0\\).* \\\[0, 999\\\]" "cp" } } */ |