Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-object-size-14.c
blob085011eda52af69883a95057b21558f1d0990185
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 extern void abort (void);
5 extern char *strncpy(char *, const char *, __SIZE_TYPE__);
7 union u {
8 struct {
9 char vi[8];
10 char pi[16];
12 char all[8+16+4];
15 void __attribute__((noinline,noclone))
16 f(union u *u)
18 char vi[8+1];
19 __builtin_strncpy(vi, u->vi, sizeof(u->vi));
20 if (__builtin_object_size (u->all, 1) != -1)
21 abort ();
23 int main()
25 union u u;
26 f (&u);
27 return 0;