OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pr35045.c] - Blame information for rev 298

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ilp32 && { ! nonpic } } } { "*" } { "" } } */
3
/* { dg-options "-O2 -fgcse-after-reload" } */
4
 
5
extern void abort (void);
6
 
7
__attribute__((noinline)) __complex__ float
8
give_neg1 (void)
9
{
10
  __complex__ float res;
11
  __real__ res = -1.0;
12
  __imag__ res = 1.0;
13
  return res;
14
}
15
 
16
__attribute__((noinline)) __complex__ float
17
mycacoshf (__complex__ float x)
18
{
19
  __complex__ float res;
20
  res = give_neg1 ();
21
 
22
  /* We have to use the positive branch.  */
23
  if (__real__ res < 0.0)
24
    {
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));
28
    }
29
  return res;
30
}
31
 
32
int main()
33
{
34
  __complex__ float res = mycacoshf(1.0);
35
  if (__imag__ res >= 0.0)
36
    abort();
37
  return 0;
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.