diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/pr54925.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr54925.c | 27 |
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; +} |