| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } } */ |
| 3 |
/* { dg-skip-if "Not enough registers" { "pdp11-*-*" } } */ |
| 4 |
/* { dg-options "-O2 -fgcse-after-reload" } */ |
| 5 |
|
| 6 |
extern void abort (void); |
| 7 |
|
| 8 |
__attribute__((noinline)) __complex__ float |
| 9 |
give_neg1 (void) |
| 10 |
{ |
| 11 |
__complex__ float res; |
| 12 |
__real__ res = -1.0; |
| 13 |
__imag__ res = 1.0; |
| 14 |
return res; |
| 15 |
} |
| 16 |
|
| 17 |
__attribute__((noinline)) __complex__ float |
| 18 |
mycacoshf (__complex__ float x) |
| 19 |
{ |
| 20 |
__complex__ float res; |
| 21 |
res = give_neg1 (); |
| 22 |
|
| 23 |
/* We have to use the positive branch. */ |
| 24 |
if (__real__ res < 0.0) |
| 25 |
{ |
| 26 |
unsigned a,b,c,d,e,f; |
| 27 |
res = -res; |
| 28 |
asm __volatile__ ("" : "=r" (a), "=r" (b), "=r" (c), "=r" (d), "=r" (e), "=r" (f)); |
| 29 |
} |
| 30 |
return res; |
| 31 |
} |
| 32 |
|
| 33 |
int main() |
| 34 |
{ |
| 35 |
__complex__ float res = mycacoshf(1.0); |
| 36 |
if (__imag__ res >= 0.0) |
| 37 |
abort(); |
| 38 |
return 0; |
| 39 |
} |