summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asan/pr105396.c
blob: d4bd7f12476318e78f1d23651ef9e73961f2c7f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR sanitizer/105396 */
/* { dg-do run } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
/* { dg-shouldfail "asan" } */

int
main ()
{
  int a;
  int *b[1];
  int c[10];
  int d[1][1];
  for (a = 0; a < 1; a++)
    d[1][a] = 0;
  return 0;
}

/* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" } */
/* { dg-output "WRITE of size.*" } */