blob: c9d896d1903bae0468843544c54081d941923cb6 [file] [log] [blame]
/* PR sanitizer/70875 */
/* { dg-do run } */
/* { dg-options "-fsanitize=bounds -fno-sanitize-recover=bounds" } */
/* { dg-shouldfail "ubsan" } */
int
foo (int n, int k)
{
struct S
{
int i[n];
int value;
} s[2];
return s[k].value = 0;
}
int
main ()
{
return foo (2, 2);
}
/* { dg-output "index 2 out of bounds for type 'S \\\[2\\\]'" } */