| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-stack-protector" } */ |
| 3 |
/* { dg-require-effective-target supports_stack_clash_protection } */ |
| 4 |
|
| 5 |
void h (void) __attribute__ ((noreturn)); |
| 6 |
|
| 7 |
void |
| 8 |
f (void) |
| 9 |
{ |
| 10 |
volatile int x[16384 + 1000]; |
| 11 |
if (x[0]) |
| 12 |
h (); |
| 13 |
x[345] = 1; |
| 14 |
h (); |
| 15 |
} |
| 16 |
|
| 17 |
/* { dg-final { scan-assembler-times {str\s+xzr, \[sp, 1024\]} 1 } } */ |
| 18 |
/* { dg-final { scan-assembler-times {str\s+x30, \[sp\]} 1 } } */ |
| 19 |
|
| 20 |
/* SIZE is more than 1 guard-size, two 64k pages used, expect only 1 explicit |
| 21 |
probe at 1024 and one implicit probe due to LR being saved. Leaf function |
| 22 |
and omitting leaf pointers, tail call to noreturn which may only omit an |
| 23 |
epilogue and not a prologue and control flow in between. Checking for |
| 24 |
LR saving. */ |