| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Os -fstrub=strict -fdump-rtl-expand -fno-stack-protector" } */ |
| 3 |
/* { dg-require-effective-target strub } */ |
| 4 |
|
| 5 |
/* At -Os, without -fno-inline, we fully expand enter, and also update. The |
| 6 |
expanded update might be larger than a call proper, but argument saving and |
| 7 |
restoring required by the call will most often make it larger. The leave |
| 8 |
call is left untouched. */ |
| 9 |
|
| 10 |
int __attribute__ ((__strub__)) var; |
| 11 |
|
| 12 |
int f() { |
| 13 |
return var; |
| 14 |
} |
| 15 |
|
| 16 |
/* { dg-final { scan-rtl-dump-not "strub_enter" "expand" } } */ |
| 17 |
/* { dg-final { scan-rtl-dump-not "strub_update" "expand" } } */ |
| 18 |
/* { dg-final { scan-rtl-dump "strub_leave" "expand" } } */ |
| 19 |
/* { dg-final { scan-rtl-dump-not "\[(\]call\[^\n\]*strub_leave.*\n\[(\]code_label" "expand" } } */ |