1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 
4 extern void abort (void);
5 
6 int
main()7 main ()
8 {
9   struct A { char buf1[9]; char buf2[1]; } a;
10 
11   if (__builtin_object_size (a.buf1 + (0 + 4), 1) != 5)
12     abort ();
13   char *p = a.buf1;
14   p += 1;
15   p += 3;
16   if (__builtin_object_size (p, 1) != 5)
17     abort ();
18   p = (char *) &a;
19   char *q = p + 1;
20   char *r = q + 3;
21   char *t = r;
22   if (r != (char *) &a + 4)
23     t = (char *) &a + 1;
24   if (__builtin_object_size (t, 1) != 6)
25     abort ();
26   return 0;
27 }
28