2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / strinline.c
blob2fe671416246067ff94acbca011b6cc470224f7e
1 /* { dg-do compile } */
2 /* { dg-require-effective-target fpic } */
3 /* { dg-options "-O2 -fPIC" } */
4 typedef unsigned int size_t;
5 char *
6 __mempcpy_by2 (char *__dest, __const char *__src, size_t __srclen)
8 register char *__tmp = __dest;
9 register unsigned long int __d0, __d1;
10 __asm__ __volatile__
11 ("shrl $1,%3\n\t"
12 "jz 2f\n"
13 "1:\n\t"
14 "movl (%2),%0\n\t"
15 "leal 4(%2),%2\n\t"
16 "movl %0,(%1)\n\t"
17 "leal 4(%1),%1\n\t"
18 "decl %3\n\t"
19 "jnz 1b\n"
20 "2:\n\t"
21 "movw (%2),%w0\n\t"
22 "movw %w0,(%1)"
23 : "=&q" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1),
24 "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
25 : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
26 "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
27 : "cc");
28 return __tmp + 2;