aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/bounds-20.c
blob: a78c67129e0d07b42444e10aeed77150de2f1e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* PR sanitizer/109050 */
/* { dg-do run } */
/* { dg-options "-fsanitize=bounds -fno-sanitize-recover=all" } */
/* { dg-shouldfail "ubsan" } */

long a;
int b;
int
main ()
{
  int c[4] = {0, 1, 2, 3};
  a = 0;
  c[a - 9806816] |= b;
}

/* { dg-output "index -9806816 out of bounds for type 'int \\\[4\\\]'" } */