aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/bounds-15.c
blob: 5fa8eee524e281ccc03b70cf87156d2ae14e3596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do run } */
/* { dg-options "-fsanitize=bounds" } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */

int main()
{
  long long offset = 10;
  char array[10];
  char c = array[offset];
  return 0;
}

/* { dg-output "index 10 out of bounds for type 'char \\\[10\\\]'" } */