OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [rbug.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
#if defined(__i386__) && defined(__FreeBSD__)
2
#include <ieeefp.h>
3
#endif
4
 
5
double d (unsigned long long k)
6
{
7
  double x;
8
 
9
  x = (double) k;
10
  return x;
11
}
12
 
13
float s (unsigned long long k)
14
{
15
  float x;
16
 
17
  x = (float) k;
18
  return x;
19
}
20
 
21
main ()
22
{
23
  unsigned long long int k;
24
  double x;
25
 
26
#if defined(__i386__) && defined(__FreeBSD__)
27
  /* This test case assumes extended-precision, but FreeBSD defaults to
28
     double-precision.  Make it so.  */
29
  fpsetprec (FP_PE);
30
#endif
31
 
32
  if (sizeof (double) >= 8)
33
    {
34
      k = 0x8693ba6d7d220401ULL;
35
      x = d (k);
36
      k = (unsigned long long) x;
37
      if (k != 0x8693ba6d7d220800ULL)
38
        abort ();
39
    }
40
 
41
  k = 0x8234508000000001ULL;
42
  x = s (k);
43
  k = (unsigned long long) x;
44
#ifdef __SPU__
45
  /* SPU float rounds towards zero.  */
46
  if (k != 0x8234500000000000ULL)
47
    abort ();
48
#else
49
  if (k != 0x8234510000000000ULL)
50
    abort ();
51
#endif
52
 
53
  exit (0);
54
}
55
 

powered by: WebSVN 2.1.0

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