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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [fp-cmp-3.c] - Blame information for rev 12

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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