| 1 |
/* Test that estimated local cloning time benefit of extern inline functions is |
| 2 |
zero. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-O3 -fdump-ipa-cp -fno-early-inlining" } */ |
| 6 |
/* { dg-add-options bind_pic_locally } */ |
| 7 |
|
| 8 |
extern int get_int (void); |
| 9 |
extern void use_stuff (int); |
| 10 |
|
| 11 |
int arr[10]; |
| 12 |
|
| 13 |
inline void |
| 14 |
f (int a) |
| 15 |
{ |
| 16 |
arr[0] += a + 5; |
| 17 |
arr[1] += a + 50; |
| 18 |
arr[2] += a - 3; |
| 19 |
arr[3] += a; |
| 20 |
arr[4] += a + 21; |
| 21 |
arr[5] += a + 900; |
| 22 |
arr[6] += a + 2; |
| 23 |
arr[7] += a + 3456; |
| 24 |
arr[8] += a + 3; |
| 25 |
arr[9] += a + 32; |
| 26 |
use_stuff (a); |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
int |
| 31 |
entry (void) |
| 32 |
{ |
| 33 |
int i; |
| 34 |
for (i = 0; i < 100; i++) |
| 35 |
f (7); |
| 36 |
for (i = 0; i < 100; i++) |
| 37 |
f (get_int ()); |
| 38 |
return 0; |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
/* { dg-final { scan-ipa-dump "loc_time: 0" "cp" } } */ |
| 43 |
/* { dg-final { scan-ipa-dump-not "replacing param.*with const" "cp" } } */ |
| 44 |
|
| 45 |
|