Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / pr35045.c
blob0b2b2090a3ba4b30efae4f9be7a8bf37b595476b
1 /* { dg-do run } */
2 /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ilp32 && { ! nonpic } } } { "*" } { "" } } */
3 /* { dg-options "-O2 -fgcse-after-reload" } */
5 extern void abort (void);
7 __attribute__((noinline)) __complex__ float
8 give_neg1 (void)
10 __complex__ float res;
11 __real__ res = -1.0;
12 __imag__ res = 1.0;
13 return res;
16 __attribute__((noinline)) __complex__ float
17 mycacoshf (__complex__ float x)
19 __complex__ float res;
20 res = give_neg1 ();
22 /* We have to use the positive branch. */
23 if (__real__ res < 0.0)
25 unsigned a,b,c,d,e,f;
26 res = -res;
27 asm __volatile__ ("" : "=r" (a), "=r" (b), "=r" (c), "=r" (d), "=r" (e), "=r" (f));
29 return res;
32 int main()
34 __complex__ float res = mycacoshf(1.0);
35 if (__imag__ res >= 0.0)
36 abort();
37 return 0;