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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [complex-1.c] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
double
2
g0 (double x)
3
{
4
  return 1.0;
5
}
6
 
7
double
8
g1 (double x)
9
{
10
  return -1.0;
11
}
12
 
13
double
14
g2 (double x)
15
{
16
  return 0.0;
17
}
18
 
19
__complex__ double
20
cexp (__complex__ double x)
21
{
22
  double r;
23
 
24
  r = g0 (__real__ x);
25
  __real__ x = r * g1 (__imag__ x);
26
  __imag__ x = r * g2 (__imag__ x);
27
  return x;
28
}
29
 
30
main ()
31
{
32
  __complex__ double x;
33
 
34
  x = cexp (1.0i);
35
  if (__real__ x != -1.0)
36
    abort ();
37
  if (__imag__ x != 0.0)
38
    abort ();
39
  exit (0);
40
}

powered by: WebSVN 2.1.0

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