summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-15 22:15:18 +0000
committerolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-15 22:15:18 +0000
commitc14a77b0f56b04110b1f8987708af53e364ca651 (patch)
tree3e2d9d9d45a6389c0918ec8e92c1ad9457145d65 /gcc/testsuite/gcc.c-torture
parent99af687ad58b1f317067ddab2d693f7bc38846cc (diff)
downloadgcc-c14a77b0f56b04110b1f8987708af53e364ca651.tar.gz
PR target/54925
* gcc.c-torture/compile/pr54925.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192482 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr54925.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr54925.c b/gcc/testsuite/gcc.c-torture/compile/pr54925.c
new file mode 100644
index 00000000000..72349c9d7d7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr54925.c
@@ -0,0 +1,27 @@
+/* PR target/54925 */
+extern int bar;
+extern void foo (int *);
+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)
+{
+ unsigned char *p = to;
+ while (len > 0)
+ {
+ len--;
+ *to++ = *from++;
+ }
+ return p;
+}