aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/hwasan/unprotected-allocas-1.c
blob: 752edc1d3ea366af771936d7680902bad7c1878c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do run } */
/* { dg-require-effective-target hwaddress_exec } */
/* { dg-additional-options "--param hwasan-instrument-allocas=0 -save-temps" } */
/* Only test there's no tagging done when not at -O0.  Without optimisation
   the compiler creates a bunch of other variables on the stack other than the
   vararray/alloca object.
   We also avoid checking when using -flto, since with LTO the compiler can
   recognise the vararray is only used with one size and that size is known at
   compile time -- when the compiler recognises that it instead creates a
   static array, which gets tagged as is expected but not as the test expects.
   */
/* { dg-skip-if "" { *-*-* } { "-O0" "-flto" } { "" } } */

#include "unprotected-allocas-0.c"

/* { dg-final { scan-assembler-not "__hwasan_tag_memory" } } */