| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-lower-details" } */ |
| 3 |
|
| 4 |
char dst[2048]; |
| 5 |
|
| 6 |
char * |
| 7 |
copy1 (const char *src, int cond) |
| 8 |
{ |
| 9 |
__builtin___stpncpy_chk (dst, src, 42, __builtin_object_size (dst, 0)); |
| 10 |
|
| 11 |
return dst; |
| 12 |
} |
| 13 |
|
| 14 |
char * |
| 15 |
copy2 (void) |
| 16 |
{ |
| 17 |
__builtin___stpcpy_chk (dst, "Hello world", __builtin_object_size (dst, 0)); |
| 18 |
|
| 19 |
return dst; |
| 20 |
} |
| 21 |
/* { dg-final { scan-tree-dump "simplified __builtin___stpncpy_chk to __builtin_strncpy" "lower" } } */ |
| 22 |
/* { dg-final { scan-tree-dump "simplified __builtin___stpcpy_chk to __builtin_strcpy" "lower" } } */ |
| 23 |
|