Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.c-torture / execute / ieee / fp-cmp-4.c
blobd4bb9c6c6b5aaef9923a1348d7a26f232db4395f
1 #ifndef FLOAT
2 #define FLOAT double
3 #endif
5 void
6 test_isunordered(FLOAT x, FLOAT y, int true)
8 if (__builtin_isunordered(x, y))
10 if (! true)
11 abort ();
13 else
15 if (true)
16 abort ();
20 void
21 test_isless(FLOAT x, FLOAT y, int true)
23 if (__builtin_isless(x, y))
25 if (! true)
26 abort ();
28 else
30 if (true)
31 abort ();
35 void
36 test_islessequal(FLOAT x, FLOAT y, int true)
38 if (__builtin_islessequal(x, y))
40 if (! true)
41 abort ();
43 else
45 if (true)
46 abort ();
50 void
51 test_isgreater(FLOAT x, FLOAT y, int true)
53 if (__builtin_isgreater(x, y))
55 if (! true)
56 abort ();
58 else
60 if (true)
61 abort ();
65 void
66 test_isgreaterequal(FLOAT x, FLOAT y, int true)
68 if (__builtin_isgreaterequal(x, y))
70 if (! true)
71 abort ();
73 else
75 if (true)
76 abort ();
80 void
81 test_islessgreater(FLOAT x, FLOAT y, int true)
83 if (__builtin_islessgreater(x, y))
85 if (! true)
86 abort ();
88 else
90 if (true)
91 abort ();
95 #define NAN (0.0 / 0.0)
97 int
98 main()
100 struct try
102 FLOAT x, y;
103 unsigned unord : 1;
104 unsigned lt : 1;
105 unsigned le : 1;
106 unsigned gt : 1;
107 unsigned ge : 1;
108 unsigned lg : 1;
111 static struct try const data[] =
113 { NAN, NAN, 1, 0, 0, 0, 0, 0 },
114 { 0.0, NAN, 1, 0, 0, 0, 0, 0 },
115 { NAN, 0.0, 1, 0, 0, 0, 0, 0 },
116 { 0.0, 0.0, 0, 0, 1, 0, 1, 0 },
117 { 1.0, 2.0, 0, 1, 1, 0, 0, 1 },
118 { 2.0, 1.0, 0, 0, 0, 1, 1, 1 },
121 const int n = sizeof(data) / sizeof(data[0]);
122 int i;
124 for (i = 0; i < n; ++i)
126 test_isunordered (data[i].x, data[i].y, data[i].unord);
127 test_isless (data[i].x, data[i].y, data[i].lt);
128 test_islessequal (data[i].x, data[i].y, data[i].le);
129 test_isgreater (data[i].x, data[i].y, data[i].gt);
130 test_isgreaterequal (data[i].x, data[i].y, data[i].ge);
131 test_islessgreater (data[i].x, data[i].y, data[i].lg);
134 exit (0);