Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-object-size-15.c
blob7ee8ac095e70c86122ac6b000a5480b43709f40f
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 #include "builtin-object-size-common.h"
6 int
7 main ()
9 struct A { char buf1[9]; char buf2[1]; } a;
11 if (__builtin_object_size (a.buf1 + (0 + 4), 1) != 5)
12 FAIL ();
13 char *p = a.buf1;
14 p += 1;
15 p += 3;
16 if (__builtin_object_size (p, 1) != 5)
17 FAIL ();
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 FAIL ();
27 DONE ();