Patchwork [SH] PR 54925 - Add test case

login
register
mail settings
Submitter Oleg Endo
Date Oct. 15, 2012, 8:38 a.m.
Message ID <1350290281.2348.61.camel@yam-132-YW-E178-FTW>
Download mbox | patch
Permalink /patch/191494/
State New
Headers show

Comments

Oleg Endo - Oct. 15, 2012, 8:38 a.m.
Hello,

This adds the test case from the PR.
Tested together with the patch posted here
http://gcc.gnu.org/ml/gcc-patches/2012-10/msg01380.html

OK?

Cheers,
Oleg

testsuite/ChangeLog:

	PR target/54925
	* gcc.c-torture/compile/pr54925.c: New.

Patch

Index: gcc/testsuite/gcc.c-torture/compile/pr54925.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr54925.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/pr54925.c	(revision 0)
@@ -0,0 +1,24 @@ 
+/* PR target/54925  */
+extern int bar;
+static unsigned char *
+nr_memcpy (unsigned char *, unsigned char *, unsigned short);
+
+void 
+baz (char *buf, unsigned short len)
+{
+  unsigned char data[10];
+  if (len == 0)
+    return;
+  nr_memcpy (data, (unsigned char *) buf, len);
+  foo (&bar);
+}
+
+static unsigned char *
+nr_memcpy (unsigned char * to, unsigned char * from, unsigned short len)
+{
+  while (len > 0)
+    {
+      len--;
+      *to++ = *from++;
+    }
+}