1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wstringop-overflow" } */
7 char b
[16] = "abcdefg";
8 __builtin_strncpy (a
, b
, __builtin_strlen (b
)); /* { dg-warning "specified bound depends on the length of the source argument" } */
14 char b
[16] = "abcdefg";
15 __builtin_strncpy (a
, b
, __builtin_strnlen (b
, 8)); /* { dg-warning "specified bound depends on the length of the source argument" } */
21 char b
[16] = "abcdefg";
22 __builtin_strncpy (a
, b
, __builtin_strnlen (b
, 7)); /* { dg-bogus "specified bound depends on the length of the source argument" } */
32 __builtin_memcpy (b
, "abcdefg", 7);
33 __builtin_strncpy (a
, b
, __builtin_strnlen (b
, 8)); /* { dg-bogus "specified bound depends on the length of the source argument" } */