aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/bounds-18.c
blob: 556abc0e1c0a771059c9cf56613d05f2a9ce2eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR sanitizer/108060 */
/* { dg-do run } */
/* { dg-options "-fsanitize=bounds" } */
/* { dg-skip-if "" { *-*-* } "-flto" } */
/* { dg-shouldfail "ubsan" } */

int a[8];
int c;

int
main ()
{
  int b = -32768;
  a[b] = a[b] | c;
}

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