aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr50604.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr50604.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr50604.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr50604.c b/gcc/testsuite/gcc.dg/pr50604.c
new file mode 100644
index 00000000000..1ab465a1095
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50604.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/50604 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include "strlenopt.h"
+
+typedef char T;
+extern const T s[];
+
+void
+foo (T *x)
+{
+ char *r = malloc (strlen (x));
+ strcpy (r, s);
+ strcat (r, x);
+ strcat (r, "/");
+}
+
+const T s[] = "abcdefghijklmnopq";