| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */ |
| 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 (2048); |
| 10 |
x = t1 (x); |
| 11 |
return p[x]; |
| 12 |
} |
| 13 |
|
| 14 |
|
| 15 |
/* This test has a constant sized alloca that is smaller than the |
| 16 |
probe interval. Only one probe is required since the value is larger |
| 17 |
than 1024 bytes but smaller than page size. |
| 18 |
|
| 19 |
The form can change quite a bit so we just check for one |
| 20 |
probe without looking at the actual address. */ |
| 21 |
/* { dg-final { scan-assembler-times {sd\tzero,1024\(sp\)} 1 } } */ |
| 22 |
|
| 23 |
|
| 24 |
|