| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fpeephole2" } */ |
| 3 |
|
| 4 |
/* can be processed */ |
| 5 |
double test0(double a, double b) { |
| 6 |
return __builtin_copysign(a, b); |
| 7 |
} |
| 8 |
|
| 9 |
/* cannot be processed: due to violate '0' constraint of the 2nd source operand. */ |
| 10 |
int test1(int a, int b) { |
| 11 |
int c; |
| 12 |
asm volatile ("" : "=a"(c) : "r"(a), "0"(b)); |
| 13 |
return c; |
| 14 |
} |
| 15 |
|
| 16 |
/* cannot be processed: due to violate '&' constraint of the destination operand. */ |
| 17 |
int test2(int a) { |
| 18 |
int b; |
| 19 |
asm volatile ("" : "=&a"(b) : "r"(a)); |
| 20 |
return b; |
| 21 |
} |
| 22 |
|
| 23 |
/* { dg-final { scan-assembler-times "mov\t|mov.n\t" 2 } } */ |