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

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
#ifndef SIGNAL_SUPPRESS
2
#include <signal.h>
3
#endif
4
 
5
double dnan = 1.0/0.0 - 1.0/0.0;
6
double x = 1.0;
7
 
8
void leave ()
9
{
10
  exit (0);
11
}
12
 
13
main ()
14
{
15
#if ! defined (__vax__) && ! defined (_CRAY)
16
  /* Move this line earlier, for architectures (like alpha) that issue
17
     SIGFPE on the first comparisons. */
18
#ifndef SIGNAL_SUPPRESS
19
  /* Some machines catches a SIGFPE when a NaN is compared.
20
     Let this test succeed o such machines.  */
21
  signal (SIGFPE, leave);
22
#endif
23
  /* NaN is an IEEE unordered operand.  All these test should be false.  */
24
  if (dnan == dnan)
25
    abort ();
26
  if (dnan != x)
27
    x = 1.0;
28
  else
29
    abort ();
30
 
31
  if (dnan < x)
32
    abort ();
33
  if (dnan > x)
34
    abort ();
35
  if (dnan <= x)
36
    abort ();
37
  if (dnan >= x)
38
    abort ();
39
  if (dnan == x)
40
    abort ();
41
#endif
42
  exit (0);
43
}

powered by: WebSVN 2.1.0

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