2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr35045.c
blob626bde4b67b155d8e3fbe0ea62557df6e6eb33d4
1 /* { dg-do run } */
2 /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! 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;