aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/vla-3.c
blob: 6003fdddf3a227b1b567f5b71806cae159d913a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do run } */
/* { dg-options "-fsanitize=vla-bound -fno-sanitize-recover=vla-bound" } */

/* Don't instrument the arrays here.  */
int
foo (int n, int a[])
{
  return a[n - 1];
}

int
main (void)
{
  int a[6] = { };
  int ret = foo (3, a);
  return ret;
}