Debian Codegraph @

gcc/testsuite/gcc.target/riscv/stack-check-15.c

raw
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 (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 three
20 probes without looking at the actual address. */
21 /* { dg-final { scan-assembler-times {sd\tzero,} 3 } } */