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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.dg/] [c99-math.h] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
#include <math.h>
2
 
3
extern void abort(void);
4
 
5
#define C99_MATH_TESTS(nan, inf, huge, norm, zero)      \
6
{                                                       \
7
  if (fpclassify (nan) != FP_NAN)                       \
8
    abort ();                                           \
9
                                                        \
10
  if (fpclassify (inf) != FP_INFINITE)                  \
11
    abort ();                                           \
12
                                                        \
13
  if (fpclassify (huge) != FP_INFINITE)                 \
14
    abort ();                                           \
15
                                                        \
16
  if (fpclassify (norm) != FP_NORMAL)                   \
17
    abort ();                                           \
18
                                                        \
19
  if (fpclassify (zero) != FP_ZERO)                     \
20
    abort ();                                           \
21
                                                        \
22
                                                        \
23
  if (!isnan (nan))                                     \
24
    abort ();                                           \
25
                                                        \
26
  if (isnan (inf))                                      \
27
    abort ();                                           \
28
                                                        \
29
  if (isnan (huge))                                     \
30
    abort ();                                           \
31
                                                        \
32
  if (isnan (norm))                                     \
33
    abort ();                                           \
34
                                                        \
35
  if (isnan (zero))                                     \
36
    abort ();                                           \
37
                                                        \
38
                                                        \
39
  if (isinf (nan))                                      \
40
    abort ();                                           \
41
                                                        \
42
  if (!isinf (inf))                                     \
43
    abort ();                                           \
44
                                                        \
45
  if (!isinf (huge))                                    \
46
    abort ();                                           \
47
                                                        \
48
  if (isnan (norm))                                     \
49
    abort ();                                           \
50
                                                        \
51
  if (isinf (zero))                                     \
52
    abort ();                                           \
53
                                                        \
54
                                                        \
55
  if (isfinite (nan))                                   \
56
    abort ();                                           \
57
                                                        \
58
  if (isfinite (inf))                                   \
59
    abort ();                                           \
60
                                                        \
61
  if (isfinite (huge))                                  \
62
    abort ();                                           \
63
                                                        \
64
  if (!isfinite (norm))                                 \
65
    abort ();                                           \
66
                                                        \
67
  if (!isfinite (zero))                                 \
68
    abort ();                                           \
69
                                                        \
70
                                                        \
71
  if (isnormal (nan))                                   \
72
    abort ();                                           \
73
                                                        \
74
  if (isnormal (inf))                                   \
75
    abort ();                                           \
76
                                                        \
77
  if (isnormal (huge))                                  \
78
    abort ();                                           \
79
                                                        \
80
  if (!isnormal (norm))                                 \
81
    abort ();                                           \
82
                                                        \
83
  if (isnormal (zero))                                  \
84
    abort ();                                           \
85
                                                        \
86
                                                        \
87
  if (signbit (norm))                                   \
88
    abort ();                                           \
89
                                                        \
90
  if (!signbit (-(norm)))                               \
91
    abort ();                                           \
92
                                                        \
93
                                                        \
94
  if (!isgreater ((inf), (norm)))                       \
95
    abort ();                                           \
96
                                                        \
97
  if (!isgreaterequal ((inf), (huge)))                  \
98
    abort ();                                           \
99
                                                        \
100
  if (!isless ((norm), (inf)))                          \
101
    abort ();                                           \
102
                                                        \
103
  if (!islessequal ((huge), (inf)))                     \
104
    abort ();                                           \
105
                                                        \
106
  if (!islessgreater ((inf), (norm)))                   \
107
    abort ();                                           \
108
                                                        \
109
  if (!isunordered ((nan), (norm)))                     \
110
    abort ();                                           \
111
}

powered by: WebSVN 2.1.0

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