| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */ |
| 3 |
/* { dg-require-effective-target supports_stack_clash_protection } */ |
| 4 |
|
| 5 |
int t1(int); |
| 6 |
|
| 7 |
int t2(int x) |
| 8 |
{ |
| 9 |
char *p = __builtin_alloca (x); |
| 10 |
x = t1 (x); |
| 11 |
return p[x]; |
| 12 |
} |
| 13 |
|
| 14 |
|
| 15 |
/* This test has a variable sized alloca. It requires 3 probes. |
| 16 |
One in the loop, one for the residual, one for when it's < 1024 and one for |
| 17 |
when it's not. |
| 18 |
|
| 19 |
The form can change quite a bit so we just check for two |
| 20 |
probes without looking at the actual address. */ |
| 21 |
/* { dg-final { scan-assembler-times "str\\txzr," 3 } } */ |