| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -mbranch-protection=none" } */ |
| 3 |
|
| 4 |
int |
| 5 |
__attribute((indirect_return,weak)) |
| 6 |
foo (int a) |
| 7 |
{ |
| 8 |
return a; |
| 9 |
} |
| 10 |
|
| 11 |
/* |
| 12 |
**func1: |
| 13 |
** ... |
| 14 |
** bl foo |
| 15 |
** ... |
| 16 |
** ret |
| 17 |
*/ |
| 18 |
int |
| 19 |
func1 (int a, int b) |
| 20 |
{ |
| 21 |
return foo (a + b); |
| 22 |
} |
| 23 |
|
| 24 |
/* |
| 25 |
**func2: |
| 26 |
** ... |
| 27 |
** b foo |
| 28 |
*/ |
| 29 |
int __attribute((indirect_return,weak)) |
| 30 |
func2 (int a, int b) |
| 31 |
{ |
| 32 |
return foo (a - b); |
| 33 |
} |
| 34 |
|
| 35 |
/* |
| 36 |
**func3: |
| 37 |
** ... |
| 38 |
** bl func2 |
| 39 |
** ... |
| 40 |
** ret |
| 41 |
*/ |
| 42 |
int |
| 43 |
func3 (int x, int y) |
| 44 |
{ |
| 45 |
return func2 (x, y); |
| 46 |
} |
| 47 |
|
| 48 |
/* { dg-final { check-function-bodies "**" "" "" } } */ |
| 49 |
/* { dg-final { scan-assembler-not {\thint\t} } } */ |