gcc/testsuite/gcc.dg/pr50604.c
raw| 1 | /* PR tree-optimization/50604 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O2" } */ |
| 4 | |
| 5 | #include "strlenopt.h" |
| 6 | |
| 7 | typedef char T; |
| 8 | extern const T s[]; |
| 9 | |
| 10 | void |
| 11 | foo (T *x) |
| 12 | { |
| 13 | char *r = malloc (strlen (x)); |
| 14 | strcpy (r, s); |
| 15 | strcat (r, x); |
| 16 | strcat (r, "/"); |
| 17 | } |
| 18 | |
| 19 | const T s[] = "abcdefghijklmnopq"; |