| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O0 -fomit-frame-pointer -fno-inline --save-temps" } */ |
| 3 |
|
| 4 |
void |
| 5 |
func_leaf (void) |
| 6 |
{ |
| 7 |
int a = 0; |
| 8 |
} |
| 9 |
|
| 10 |
void |
| 11 |
func_no_leaf (void) |
| 12 |
{ |
| 13 |
int a = 0; |
| 14 |
func_leaf (); |
| 15 |
} |
| 16 |
|
| 17 |
void |
| 18 |
func1 (void) |
| 19 |
{ |
| 20 |
int a = 0; |
| 21 |
func_no_leaf (); |
| 22 |
} |
| 23 |
|
| 24 |
/* |
| 25 |
* This function calls XXX(), which modifies SP. This is incompatible to |
| 26 |
* -fomit-frame-pointer generated code as SP is used to access the frame. |
| 27 |
*/ |
| 28 |
__attribute__ ((optimize("no-omit-frame-pointer"))) |
| 29 |
void |
| 30 |
func2 (void) |
| 31 |
{ |
| 32 |
int a = 0; |
| 33 |
func_no_leaf (); |
| 34 |
} |
| 35 |
|
| 36 |
void |
| 37 |
func3 (void) |
| 38 |
{ |
| 39 |
int a = 0; |
| 40 |
func_no_leaf (); |
| 41 |
} |
| 42 |
|
| 43 |
/* { dg-final { scan-assembler-times "stp\tx29, x30, \\\[sp, -\[0-9\]+\\\]!" 1 } } */ |
| 44 |
|