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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [920410-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 688 jeremybenn
int alloc_float(f)
2
 float f;
3
{  union
4
    {
5
      float f;
6
      int i;
7
    }
8
  u;
9
  u.f=f;
10
  return u.i&~1;
11
}
12
 
13
float c_float(int obj)
14
{  union
15
    {
16
      float f;
17
      int i;
18
    } u;
19
 
20
  u.i=obj;
21
  return u.f;
22
}
23
 
24
main()
25
{ int x=alloc_float(1.2);
26
  int y=alloc_float(5.7);
27
  int z=alloc_float(c_float(x)*c_float(y));
28
 
29
  printf("%g\n",(double)c_float(z));
30
}

powered by: WebSVN 2.1.0

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