Debian Codegraph @

gcc/testsuite/gcc.target/riscv/stack-check-alloca-1.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 #define SIZE y
6 #include "stack-check-alloca.h"
7
8 /* { dg-final { scan-assembler-times {sd\tzero,1024\(sp\)} 2 } } */
9 /* { dg-final { scan-assembler-times {sd\tzero,0\(sp\)} 1 } } */
10
11 /* Dynamic alloca, expect loop, and 2 probes with 1kB offset and 1 at sp.
12 1st probe is inside the loop for the full guard-size allocations, second
13 probe is for the case where residual is zero and the final probe for when
14 residiual is > 1024 bytes. */