1/* PR sanitizer/65081 */
2/* { dg-do run } */
3/* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
4/* { dg-options "-fsanitize=object-size -fno-sanitize-recover=object-size" } */
5
6struct S
7{
8  int a;
9  char p[1];
10};
11
12struct S b;
13
14struct S *
15foo ()
16{
17  struct S *i = &b;
18  return i + 1;
19}
20
21int
22main (void)
23{
24  struct S *i = foo () - 1;
25  i->a = 1;
26}
27