aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/riscv/stack-check-alloca-6.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/riscv/stack-check-alloca-6.c')
-rw-r--r--gcc/testsuite/gcc.target/riscv/stack-check-alloca-6.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/riscv/stack-check-alloca-6.c b/gcc/testsuite/gcc.target/riscv/stack-check-alloca-6.c
new file mode 100644
index 0000000..d937e92
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/stack-check-alloca-6.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+/* { dg-require-effective-target alloca } */
+
+#define SIZE 2.5 * 1024
+#include "stack-check-alloca.h"
+
+/* { dg-final { scan-assembler-times {sd\tzero,1024\(sp\)} 1 } } */
+
+/* Alloca is more than 1kB, but less than guard-size, 1 probe expected at 1kB
+ offset. */