1 /* { dg-do run } */ 2 /* { dg-options "-O2" } */ 3 4 extern void abort (void); 5 extern char *strncpy(char *, const char *, __SIZE_TYPE__); 6 7 union u { 8 struct { 9 char vi[8]; 10 char pi[16]; 11 }; 12 char all[8+16+4]; 13 }; 14 15 void __attribute__((noinline,noclone)) f(union u * u)16f(union u *u) 17 { 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 (); 22 } main()23int main() 24 { 25 union u u; 26 f (&u); 27 return 0; 28 } 29