OSDN Git Service

16f8799c52d107b3748b15427adec7c998f918fe
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / pr35045.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fgcse-after-reload" } */
3
4 extern void abort (void);
5
6 __attribute__((noinline)) __complex__ float
7 give_neg1 (void)
8 {
9   __complex__ float res;
10   __real__ res = -1.0;
11   __imag__ res = 1.0;
12   return res;
13 }
14
15 __attribute__((noinline)) __complex__ float
16 mycacoshf (__complex__ float x)
17 {
18   __complex__ float res;
19   res = give_neg1 ();
20
21   /* We have to use the positive branch.  */
22   if (__real__ res < 0.0)
23     {
24       unsigned a,b,c,d,e,f;
25       res = -res; 
26       asm __volatile__ ("" : "=r" (a), "=r" (b), "=r" (c), "=r" (d), "=r" (e), "=r" (f));
27     }
28   return res;
29 }
30
31 int main()
32 {
33   __complex__ float res = mycacoshf(1.0);
34   if (__imag__ res >= 0.0)
35     abort();
36   return 0;
37 }