summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr17724-1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/pr17724-1.C')
-rw-r--r--gcc/testsuite/g++.dg/opt/pr17724-1.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/pr17724-1.C b/gcc/testsuite/g++.dg/opt/pr17724-1.C
new file mode 100644
index 000000000..79de663b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr17724-1.C
@@ -0,0 +1,23 @@
+// PR tree-optimization/17724
+// { dg-do compile }
+// { dg-options "-O2" }
+
+namespace N { char *strcpy (char *, const char *); }
+extern "C" char *strcpy (char *, const char *) throw ();
+inline char *N::strcpy (char *s, const char *t) { return ::strcpy (s, t); }
+
+struct S { ~S (); };
+int foo ();
+
+int
+main ()
+{
+ S s;
+ int a;
+ char b[64];
+ N::strcpy (b, "ABCDEFGHIJKLM");
+ while ((a = foo ()) != -1)
+ if (a)
+ return -1;
+ return 0;
+}