* config/sparc/driver-sparc.c (cpu_names): Add SPARC-T5 entry.
[official-gcc.git] / gcc / testsuite / g++.dg / charset / asm2.c
blob3907d32fe86d21a36198ddf84fc019750e54f19d
1 /* Test for complex asm statements. Make sure it compiles
2 then test for some of the asm statements not being translated. */
3 /* { dg-do compile { target i?86-*-* x86_64-*-* } }
4 { dg-require-iconv "IBM1047" }
5 { dg-final { scan-assembler "std" } }
6 { dg-final { scan-assembler "cld" } }
7 { dg-final { scan-assembler "rep" } }
8 { dg-final { scan-assembler "movsb" } } */
9 #define size_t int
10 void *
11 memmove (void *__dest, __const void *__src, size_t __n)
13 #if __cplusplus <= 201402L
14 register
15 #endif
16 unsigned long int __d0, __d1, __d2;
17 if (__dest < __src)
18 __asm__ __volatile__
19 ("cld\n\t"
20 "rep\n\t"
21 "movsb"
22 : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
23 : "0" (__n), "1" (__src), "2" (__dest)
24 : "memory");
25 else
26 __asm__ __volatile__
27 ("std\n\t"
28 "rep\n\t"
29 "movsb\n\t"
30 "cld"
31 : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
32 : "0" (__n), "1" (__n - 1 + (const char *) __src),
33 "2" (__n - 1 + (char *) __dest)
34 : "memory");
35 return __dest;