aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/stack-check-18.c
blob: a0aab4a982386a7855e535931372cb9df6e6b7d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand -fno-stack-protector" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */

int f1 (char *);

int
f2 (void)
{
  const int size = 4096;
  char buffer[size];
  return f1 (buffer);
}

/* So we want to verify that at expand time that we probed the main
   VLA allocation as well as the residuals.  Then we want to verify
   there was only one probe in the final assembly (implying the
   residual probe was optimized away).  */
/* { dg-final { scan-rtl-dump-times "allocation and probing in loop" 1 "expand" } } */
/* { dg-final { scan-rtl-dump-times "allocation and probing residuals" 1 "expand" } } */

/* { dg-final { scan-assembler-times "or\[ql\]" 1 } } */