]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/include/tgmath/tgmath.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / include / tgmath / tgmath.c
1 /*-
2  * Copyright (c) 2004 Stefan Farfeleder <stefanf@FreeBSD.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28
29 #include <sys/cdefs.h>
30 /* All of our functions have side effects, __pure2 causes functions calls to
31  * be optimised away.  Stop that. */
32 #undef __pure2
33 #define __pure2
34
35 #include <assert.h>
36 #include <stdio.h>
37 #include <tgmath.h>
38
39 int n_float, n_double, n_long_double;
40 int n_float_complex, n_double_complex, n_long_double_complex;
41
42 int currtest = 0;
43
44 #define TGMACRO(FNC)                                                    \
45         TGMACRO_REAL(FNC)                                               \
46         TGMACRO_COMPLEX(c ## FNC)
47
48 #define TGMACRO_REAL(FNC)                                               \
49         float (FNC ## f)(float x) { n_float++; }                        \
50         double (FNC)(double x) { n_double++; }                          \
51         long double (FNC ## l)(long double x) { n_long_double++; }
52
53 #define TGMACRO_REAL_REAL(FNC)                                          \
54         float (FNC ## f)(float x, float y) { n_float++; }               \
55         double (FNC)(double x, double y) { n_double++; }                \
56         long double                                                     \
57         (FNC ## l)(long double x, long double y) { n_long_double++; }
58
59 #define TGMACRO_REAL_FIXED_RET(FNC, TYPE)                               \
60         TYPE (FNC ## f)(float x) { n_float++; }                         \
61         TYPE (FNC)(double x) { n_double++; }                            \
62         TYPE (FNC ## l)(long double x) { n_long_double++; }
63
64 #define TGMACRO_COMPLEX(FNC)                                            \
65         float complex (FNC ## f)(float complex x) { n_float_complex++; }\
66         double complex (FNC)(double complex x) { n_double_complex++; }  \
67         long double complex                                             \
68         (FNC ## l)(long double complex x) { n_long_double_complex++; }
69
70 #define TGMACRO_COMPLEX_REAL_RET(FNC)                                   \
71         float (FNC ## f)(float complex x) { n_float_complex++; }        \
72         double (FNC)(double complex x) { n_double_complex++; }          \
73         long double                                                     \
74         (FNC ## l)(long double complex x) { n_long_double_complex++; }
75
76
77 /* 7.22#4 */
78 TGMACRO(acos)
79 TGMACRO(asin)
80 TGMACRO(atan)
81 TGMACRO(acosh)
82 TGMACRO(asinh)
83 TGMACRO(atanh)
84 TGMACRO(cos)
85 TGMACRO(sin)
86 TGMACRO(tan)
87 TGMACRO(cosh)
88 TGMACRO(sinh)
89 TGMACRO(tanh)
90 TGMACRO(exp)
91 TGMACRO(log)
92 TGMACRO_REAL_REAL(pow)
93 float complex (cpowf)(float complex x, float complex y) { n_float_complex++; }
94 double complex
95 (cpow)(double complex x, double complex y) { n_double_complex++; }
96 long double complex
97 (cpowl)(long double complex x, long double complex y)
98 { n_long_double_complex++; }
99 TGMACRO(sqrt)
100 TGMACRO_REAL(fabs)
101 TGMACRO_COMPLEX_REAL_RET(cabs)
102
103 /* 7.22#5 */
104 TGMACRO_REAL_REAL(atan2)
105 TGMACRO_REAL(cbrt)
106 TGMACRO_REAL(ceil)
107 TGMACRO_REAL_REAL(copysign)
108 TGMACRO_REAL(erf)
109 TGMACRO_REAL(erfc)
110 TGMACRO_REAL(exp2)
111 TGMACRO_REAL(expm1)
112 TGMACRO_REAL_REAL(fdim)
113 TGMACRO_REAL(floor)
114 float (fmaf)(float x, float y, float z) { n_float++; }
115 double (fma)(double x, double y, double z) { n_double++; }
116 long double
117 (fmal)(long double x, long double y, long double z) { n_long_double++; }
118 TGMACRO_REAL_REAL(fmax)
119 TGMACRO_REAL_REAL(fmin)
120 TGMACRO_REAL_REAL(fmod)
121 float (frexpf)(float x, int *e) { n_float++; }
122 double (frexp)(double x, int *e) { n_double++; }
123 long double (frexpl)(long double x, int *e) { n_long_double++; }
124 TGMACRO_REAL_REAL(hypot)
125 TGMACRO_REAL_FIXED_RET(ilogb, int)
126 float (ldexpf)(float x, int e) { n_float++; }
127 double (ldexp)(double x, int e) { n_double++; }
128 long double (ldexpl)(long double x, int e) { n_long_double++; }
129 TGMACRO_REAL(lgamma)
130 TGMACRO_REAL_FIXED_RET(llrint, long long)
131 TGMACRO_REAL_FIXED_RET(llround, long long)
132 TGMACRO_REAL(log10)
133 TGMACRO_REAL(log1p)
134 TGMACRO_REAL(log2)
135 TGMACRO_REAL(logb)
136 TGMACRO_REAL_FIXED_RET(lrint, long)
137 TGMACRO_REAL_FIXED_RET(lround, long)
138 TGMACRO_REAL(nearbyint)
139 TGMACRO_REAL_REAL(nextafter)
140 float (nexttowardf)(float x, long double y) { n_float++; }
141 double (nexttoward)(double x, long double y) { n_double++; }
142 long double (nexttowardl)(long double x, long double y) { n_long_double++; }
143 TGMACRO_REAL_REAL(remainder)
144 float (remquof)(float x, float y, int *q) { n_float++; }
145 double (remquo)(double x, double y, int *q) { n_double++; }
146 long double (remquol)(long double x, long double y, int *q) { n_long_double++; }
147 TGMACRO_REAL(rint)
148 TGMACRO_REAL(round)
149 float (scalbnf)(float x, int n) { n_float++; }
150 double (scalbn)(double x, int n) { n_double++; }
151 long double (scalbnl)(long double x, int n) { n_long_double++; }
152 float (scalblnf)(float x, long n) { n_float++; }
153 double (scalbln)(double x, long n) { n_double++; }
154 long double (scalblnl)(long double x, long n) { n_long_double++; }
155 TGMACRO_REAL(tgamma)
156 TGMACRO_REAL(trunc)
157
158 /* 7.22#6 */
159 TGMACRO_COMPLEX_REAL_RET(carg)
160 TGMACRO_COMPLEX_REAL_RET(cimag)
161 TGMACRO_COMPLEX(conj)
162 TGMACRO_COMPLEX(cproj)
163 TGMACRO_COMPLEX_REAL_RET(creal)
164
165
166 long double ld;
167 double d;
168 float f;
169 long double complex ldc;
170 double complex dc;
171 float complex fc;
172 unsigned long long ull;
173 int i;
174 _Bool b;
175
176 #define SAMETYPE(EXP, TYPE)                                             \
177         __builtin_types_compatible_p(__typeof__(EXP), TYPE)
178
179 #define CLEAR_COUNTERS                                                  \
180         (n_float = n_double = n_long_double = 0,                        \
181             n_float_complex = n_double_complex = n_long_double_complex = 0, 1)
182
183 #define RUN_TEST(EXP, TYPE)     (EXP, SAMETYPE(EXP, TYPE))
184
185 #define PASS_REAL_ARG_REAL_RET(FNC) PASS_REAL_ARG_REAL_RET_(FNC,)
186
187 #define PASS_REAL_ARG_REAL_RET_(FNC, SUFFIX)                            \
188         CLEAR_COUNTERS &&                                               \
189         RUN_TEST(FNC(1.l), long double) &&                              \
190         RUN_TEST(FNC(ld), long double) &&                               \
191         n_long_double ## SUFFIX == 2 &&                                 \
192         RUN_TEST(FNC(1.), double) &&                                    \
193         RUN_TEST(FNC(d), double) &&                                     \
194         RUN_TEST(FNC(1ull), double) &&                                  \
195         RUN_TEST(FNC(ull), double) &&                                   \
196         RUN_TEST(FNC(1), double) &&                                     \
197         RUN_TEST(FNC(i), double) &&                                     \
198         RUN_TEST(FNC((_Bool)0), double) &&                              \
199         RUN_TEST(FNC(b), double) &&                                     \
200         n_double ## SUFFIX == 8 &&                                      \
201         RUN_TEST(FNC(1.f), float) &&                                    \
202         RUN_TEST(FNC(f), float) &&                                      \
203         n_float ## SUFFIX == 2
204
205 #define PASS_REAL_ARG_FIXED_RET(FNC, RET)                               \
206         CLEAR_COUNTERS &&                                               \
207         RUN_TEST(FNC(1.l), RET) &&                                      \
208         RUN_TEST(FNC(ld), RET) &&                                       \
209         n_long_double == 2 &&                                           \
210         RUN_TEST(FNC(1.), RET) &&                                       \
211         RUN_TEST(FNC(d), RET) &&                                        \
212         RUN_TEST(FNC(1ull), RET) &&                                     \
213         RUN_TEST(FNC(ull), RET) &&                                      \
214         RUN_TEST(FNC(1), RET) &&                                        \
215         RUN_TEST(FNC(i), RET) &&                                        \
216         RUN_TEST(FNC((_Bool)0), RET) &&                                 \
217         RUN_TEST(FNC(b), RET) &&                                        \
218         n_double == 8 &&                                                \
219         RUN_TEST(FNC(1.f), RET) &&                                      \
220         RUN_TEST(FNC(f), RET) &&                                        \
221         n_float == 2
222
223 #define PASS_REAL_FIXED_ARG_REAL_RET(FNC, ARG2)                         \
224         CLEAR_COUNTERS &&                                               \
225         RUN_TEST(FNC(1.l, ARG2), long double) &&                        \
226         RUN_TEST(FNC(ld, ARG2), long double) &&                         \
227         n_long_double == 2 &&                                           \
228         RUN_TEST(FNC(1., ARG2), double) &&                              \
229         RUN_TEST(FNC(d, ARG2), double) &&                               \
230         RUN_TEST(FNC(1ull, ARG2), double) &&                            \
231         RUN_TEST(FNC(ull, ARG2), double) &&                             \
232         RUN_TEST(FNC(1, ARG2), double) &&                               \
233         RUN_TEST(FNC(i, ARG2), double) &&                               \
234         RUN_TEST(FNC((_Bool)0, ARG2), double) &&                        \
235         RUN_TEST(FNC(b, ARG2), double) &&                               \
236         n_double == 8 &&                                                \
237         RUN_TEST(FNC(1.f, ARG2), float) &&                              \
238         RUN_TEST(FNC(f, ARG2), float) &&                                \
239         n_float == 2
240
241 #define PASS_REAL_REAL_ARG_REAL_RET(FNC)                                \
242         CLEAR_COUNTERS &&                                               \
243         RUN_TEST(FNC(1.l, 1.l), long double) &&                         \
244         RUN_TEST(FNC(1.l, 1.), long double) &&                          \
245         RUN_TEST(FNC(1.l, 1.f), long double) &&                         \
246         RUN_TEST(FNC(1.l, 1), long double) &&                           \
247         RUN_TEST(FNC(1.l, (_Bool)0), long double) &&                    \
248         RUN_TEST(FNC(1.l, ld), long double) &&                          \
249         RUN_TEST(FNC(1., ld), long double) &&                           \
250         RUN_TEST(FNC(1.f, ld), long double) &&                          \
251         RUN_TEST(FNC(1, ld), long double) &&                            \
252         RUN_TEST(FNC((_Bool)0, ld), long double) &&                     \
253         n_long_double == 10 &&                                          \
254         RUN_TEST(FNC(d, 1.), double) &&                                 \
255         RUN_TEST(FNC(d, 1.f), double) &&                                \
256         RUN_TEST(FNC(d, 1l), double) &&                                 \
257         RUN_TEST(FNC(d, (_Bool)0), double) &&                           \
258         RUN_TEST(FNC(1., 1.), double) &&                                \
259         RUN_TEST(FNC(1.f, 1.), double) &&                               \
260         RUN_TEST(FNC(1l, 1.), double) &&                                \
261         RUN_TEST(FNC((_Bool)0, 1.), double) &&                          \
262         RUN_TEST(FNC(1ull, f), double) &&                               \
263         RUN_TEST(FNC(1.f, ull), double) &&                              \
264         RUN_TEST(FNC(1, 1l), double) &&                                 \
265         RUN_TEST(FNC(1u, i), double) &&                                 \
266         RUN_TEST(FNC((_Bool)0, 1.f), double) &&                         \
267         RUN_TEST(FNC(1.f, b), double) &&                                \
268         n_double == 14 &&                                               \
269         RUN_TEST(FNC(1.f, 1.f), float) &&                               \
270         RUN_TEST(FNC(1.f, 1.f), float) &&                               \
271         RUN_TEST(FNC(f, 1.f), float) &&                                 \
272         RUN_TEST(FNC(f, f), float) &&                                   \
273         n_float == 4
274
275 #define PASS_REAL_REAL_FIXED_ARG_REAL_RET(FNC, ARG3)                    \
276         CLEAR_COUNTERS &&                                               \
277         RUN_TEST(FNC(1.l, 1.l, ARG3), long double) &&                   \
278         RUN_TEST(FNC(1.l, 1., ARG3), long double) &&                    \
279         RUN_TEST(FNC(1.l, 1.f, ARG3), long double) &&                   \
280         RUN_TEST(FNC(1.l, 1, ARG3), long double) &&                     \
281         RUN_TEST(FNC(1.l, (_Bool)0, ARG3), long double) &&              \
282         RUN_TEST(FNC(1.l, ld, ARG3), long double) &&                    \
283         RUN_TEST(FNC(1., ld, ARG3), long double) &&                     \
284         RUN_TEST(FNC(1.f, ld, ARG3), long double) &&                    \
285         RUN_TEST(FNC(1, ld, ARG3), long double) &&                      \
286         RUN_TEST(FNC((_Bool)0, ld, ARG3), long double) &&               \
287         n_long_double == 10 &&                                          \
288         RUN_TEST(FNC(d, 1., ARG3), double) &&                           \
289         RUN_TEST(FNC(d, 1.f, ARG3), double) &&                          \
290         RUN_TEST(FNC(d, 1l, ARG3), double) &&                           \
291         RUN_TEST(FNC(d, (_Bool)0, ARG3), double) &&                     \
292         RUN_TEST(FNC(1., 1., ARG3), double) &&                          \
293         RUN_TEST(FNC(1.f, 1., ARG3), double) &&                         \
294         RUN_TEST(FNC(1l, 1., ARG3), double) &&                          \
295         RUN_TEST(FNC((_Bool)0, 1., ARG3), double) &&                    \
296         RUN_TEST(FNC(1ull, f, ARG3), double) &&                         \
297         RUN_TEST(FNC(1.f, ull, ARG3), double) &&                        \
298         RUN_TEST(FNC(1, 1l, ARG3), double) &&                           \
299         RUN_TEST(FNC(1u, i, ARG3), double) &&                           \
300         RUN_TEST(FNC((_Bool)0, 1.f, ARG3), double) &&                   \
301         RUN_TEST(FNC(1.f, b, ARG3), double) &&                          \
302         n_double == 14 &&                                               \
303         RUN_TEST(FNC(1.f, 1.f, ARG3), float) &&                         \
304         RUN_TEST(FNC(1.f, 1.f, ARG3), float) &&                         \
305         RUN_TEST(FNC(f, 1.f, ARG3), float) &&                           \
306         RUN_TEST(FNC(f, f, ARG3), float) &&                             \
307         n_float == 4
308
309 #define PASS_REAL_REAL_REAL_ARG_REAL_RET(FNC)                           \
310         CLEAR_COUNTERS &&                                               \
311         RUN_TEST(FNC(ld, d, f), long double) &&                         \
312         RUN_TEST(FNC(1, ld, ld), long double) &&                        \
313         RUN_TEST(FNC(1, d, ld), long double) &&                         \
314         n_long_double == 3 &&                                           \
315         RUN_TEST(FNC(1, f, 1.f), double) &&                             \
316         RUN_TEST(FNC(f, d, 1.f), double) &&                             \
317         RUN_TEST(FNC(f, 1.f, 1.), double) &&                            \
318         n_double == 3 &&                                                \
319         RUN_TEST(FNC(f, 1.f, f), float) &&                              \
320         n_float == 1
321
322 #define PASS_REAL_ARG_COMPLEX_RET(FNC)                                  \
323         CLEAR_COUNTERS &&                                               \
324         RUN_TEST(FNC(1.l), long double complex) &&                      \
325         RUN_TEST(FNC(ld), long double complex) &&                       \
326         n_long_double_complex == 2 &&                                   \
327         RUN_TEST(FNC(1.), double complex) &&                            \
328         RUN_TEST(FNC(d), double complex) &&                             \
329         RUN_TEST(FNC(1l), double complex) &&                            \
330         RUN_TEST(FNC(i), double complex) &&                             \
331         RUN_TEST(FNC(b), double complex) &&                             \
332         n_double_complex == 5 &&                                        \
333         RUN_TEST(FNC(1.f), float complex) &&                            \
334         RUN_TEST(FNC(f), float complex) &&                              \
335         n_float_complex == 2
336
337 #define PASS_COMPLEX_ARG_COMPLEX_RET(FNC)                               \
338         CLEAR_COUNTERS &&                                               \
339         RUN_TEST(FNC(ldc), long double complex) &&                      \
340         n_long_double_complex == 1 &&                                   \
341         RUN_TEST(FNC(dc), double complex) &&                            \
342         n_double_complex == 1 &&                                        \
343         RUN_TEST(FNC(fc), float complex) &&                             \
344         RUN_TEST(FNC(I), float complex) &&                              \
345         n_float_complex == 2
346
347 #define PASS_COMPLEX_ARG_REAL_RET(FNC)                                  \
348         CLEAR_COUNTERS &&                                               \
349         RUN_TEST(FNC(ldc), long double) &&                              \
350         n_long_double_complex == 1 &&                                   \
351         RUN_TEST(FNC(dc), double) &&                                    \
352         n_double_complex == 1 &&                                        \
353         RUN_TEST(FNC(fc), float) &&                                     \
354         RUN_TEST(FNC(I), float) &&                                      \
355         n_float_complex == 2
356
357 #define PASS_COMPLEX_COMPLEX_ARG_COMPLEX_RET(FNC)                       \
358         CLEAR_COUNTERS &&                                               \
359         RUN_TEST(FNC(ldc, ldc), long double complex) &&                 \
360         RUN_TEST(FNC(ldc, dc), long double complex) &&                  \
361         RUN_TEST(FNC(ldc, fc), long double complex) &&                  \
362         RUN_TEST(FNC(ldc, ld), long double complex) &&                  \
363         RUN_TEST(FNC(ldc, d), long double complex) &&                   \
364         RUN_TEST(FNC(ldc, f), long double complex) &&                   \
365         RUN_TEST(FNC(ldc, i), long double complex) &&                   \
366         RUN_TEST(FNC(dc, ldc), long double complex) &&                  \
367         RUN_TEST(FNC(I, ldc), long double complex) &&                   \
368         RUN_TEST(FNC(1.l, ldc), long double complex) &&                 \
369         RUN_TEST(FNC(1., ldc), long double complex) &&                  \
370         RUN_TEST(FNC(1.f, ldc), long double complex) &&                 \
371         RUN_TEST(FNC(1, ldc), long double complex) &&                   \
372         RUN_TEST(FNC(ld, dc), long double complex) &&                   \
373         RUN_TEST(FNC(ld, fc), long double complex) &&                   \
374         RUN_TEST(FNC(I, 1.l), long double complex) &&                   \
375         RUN_TEST(FNC(dc, 1.l), long double complex) &&                  \
376         n_long_double_complex == 17 &&                                  \
377         RUN_TEST(FNC(dc, dc), double complex) &&                        \
378         RUN_TEST(FNC(dc, fc), double complex) &&                        \
379         RUN_TEST(FNC(dc, d), double complex) &&                         \
380         RUN_TEST(FNC(dc, f), double complex) &&                         \
381         RUN_TEST(FNC(dc, ull), double complex) &&                       \
382         RUN_TEST(FNC(I, dc), double complex) &&                         \
383         RUN_TEST(FNC(1., dc), double complex) &&                        \
384         RUN_TEST(FNC(1, dc), double complex) &&                         \
385         RUN_TEST(FNC(fc, d), double complex) &&                         \
386         RUN_TEST(FNC(1, I), double complex) &&                          \
387         n_double_complex == 10 &&                                       \
388         RUN_TEST(FNC(fc, fc), float complex) &&                         \
389         RUN_TEST(FNC(fc, I), float complex) &&                          \
390         RUN_TEST(FNC(1.f, fc), float complex) &&                        \
391         n_float_complex == 3
392
393 int failed = 0;
394 #define PRINT(STR, X) do {                                              \
395         currtest++;                                                     \
396         int result = (X);                                               \
397         if (!result)                                                    \
398                 failed = 1;                                             \
399         printf("%s %d - %s\n", result ? "ok" : "not ok", currtest, (STR));              \
400         fflush(stdout);                                                 \
401 } while (0)
402
403 int
404 main(void)
405 {
406         printf("1..60\n");
407
408         /* 7.22#4 */
409         PRINT("acos",
410             PASS_REAL_ARG_REAL_RET(acos) &&
411             PASS_COMPLEX_ARG_COMPLEX_RET(acos));
412
413         PRINT("asin",
414             PASS_REAL_ARG_REAL_RET(asin) &&
415             PASS_COMPLEX_ARG_COMPLEX_RET(asin));
416
417         PRINT("atan",
418             PASS_REAL_ARG_REAL_RET(atan) &&
419             PASS_COMPLEX_ARG_COMPLEX_RET(atan));
420
421         PRINT("acosh",
422             PASS_REAL_ARG_REAL_RET(acosh) &&
423             PASS_COMPLEX_ARG_COMPLEX_RET(acosh));
424
425         PRINT("asinh",
426             PASS_REAL_ARG_REAL_RET(asinh) &&
427             PASS_COMPLEX_ARG_COMPLEX_RET(asinh));
428
429         PRINT("atanh",
430             PASS_REAL_ARG_REAL_RET(atanh) &&
431             PASS_COMPLEX_ARG_COMPLEX_RET(atanh));
432
433         PRINT("cos",
434             PASS_REAL_ARG_REAL_RET(cos) &&
435             PASS_COMPLEX_ARG_COMPLEX_RET(cos));
436
437         PRINT("sin",
438             PASS_REAL_ARG_REAL_RET(sin) &&
439             PASS_COMPLEX_ARG_COMPLEX_RET(sin));
440
441         PRINT("tan",
442             PASS_REAL_ARG_REAL_RET(tan) &&
443             PASS_COMPLEX_ARG_COMPLEX_RET(tan));
444
445         PRINT("cosh",
446             PASS_REAL_ARG_REAL_RET(cosh) &&
447             PASS_COMPLEX_ARG_COMPLEX_RET(cosh));
448
449         PRINT("sinh",
450             PASS_REAL_ARG_REAL_RET(sinh) &&
451             PASS_COMPLEX_ARG_COMPLEX_RET(sinh));
452
453         PRINT("tanh",
454             PASS_REAL_ARG_REAL_RET(tanh) &&
455             PASS_COMPLEX_ARG_COMPLEX_RET(tanh));
456
457         PRINT("exp",
458             PASS_REAL_ARG_REAL_RET(exp) &&
459             PASS_COMPLEX_ARG_COMPLEX_RET(exp));
460
461         PRINT("log",
462             PASS_REAL_ARG_REAL_RET(log) &&
463             PASS_COMPLEX_ARG_COMPLEX_RET(log));
464
465         PRINT("pow",
466             PASS_REAL_REAL_ARG_REAL_RET(pow) &&
467             PASS_COMPLEX_COMPLEX_ARG_COMPLEX_RET(pow));
468
469         PRINT("sqrt",
470             PASS_REAL_ARG_REAL_RET(sqrt) &&
471             PASS_COMPLEX_ARG_COMPLEX_RET(sqrt));
472
473         PRINT("fabs",
474             PASS_REAL_ARG_REAL_RET(fabs) &&
475             PASS_COMPLEX_ARG_REAL_RET(fabs));
476
477         /* 7.22#5 */
478         PRINT("atan2",
479             PASS_REAL_REAL_ARG_REAL_RET(atan2));
480
481         PRINT("cbrt",
482             PASS_REAL_ARG_REAL_RET(cbrt));
483
484         PRINT("ceil",
485             PASS_REAL_ARG_REAL_RET(ceil));
486
487         PRINT("copysign",
488             PASS_REAL_REAL_ARG_REAL_RET(copysign));
489
490         PRINT("erf",
491             PASS_REAL_ARG_REAL_RET(erf));
492
493         PRINT("erfc",
494             PASS_REAL_ARG_REAL_RET(erfc));
495
496         PRINT("exp2",
497             PASS_REAL_ARG_REAL_RET(exp2));
498
499         PRINT("expm1",
500             PASS_REAL_ARG_REAL_RET(expm1));
501
502         PRINT("fdim",
503             PASS_REAL_REAL_ARG_REAL_RET(fdim));
504
505         PRINT("floor",
506             PASS_REAL_ARG_REAL_RET(floor));
507
508         PRINT("fma",
509             PASS_REAL_REAL_REAL_ARG_REAL_RET(fma));
510
511         PRINT("fmax",
512             PASS_REAL_REAL_ARG_REAL_RET(fmax));
513
514         PRINT("fmin",
515             PASS_REAL_REAL_ARG_REAL_RET(fmin));
516
517         PRINT("fmod",
518             PASS_REAL_REAL_ARG_REAL_RET(fmod));
519
520         PRINT("frexp",
521             PASS_REAL_FIXED_ARG_REAL_RET(frexp, &i));
522
523         PRINT("hypot",
524             PASS_REAL_REAL_ARG_REAL_RET(hypot));
525
526         PRINT("ilogb",
527             PASS_REAL_ARG_FIXED_RET(ilogb, int));
528
529         PRINT("ldexp",
530             PASS_REAL_FIXED_ARG_REAL_RET(ldexp, 1) &&
531             PASS_REAL_FIXED_ARG_REAL_RET(ldexp, ld) &&
532             PASS_REAL_FIXED_ARG_REAL_RET(ldexp, ldc));
533
534         PRINT("lgamma",
535             PASS_REAL_ARG_REAL_RET(lgamma));
536
537         PRINT("llrint",
538             PASS_REAL_ARG_FIXED_RET(llrint, long long));
539
540         PRINT("llround",
541             PASS_REAL_ARG_FIXED_RET(llround, long long));
542
543         PRINT("log10",
544             PASS_REAL_ARG_REAL_RET(log10));
545
546         PRINT("log1p",
547             PASS_REAL_ARG_REAL_RET(log1p));
548
549         PRINT("log2",
550             PASS_REAL_ARG_REAL_RET(log2));
551
552         PRINT("logb",
553             PASS_REAL_ARG_REAL_RET(logb));
554
555         PRINT("lrint",
556             PASS_REAL_ARG_FIXED_RET(lrint, long));
557
558         PRINT("lround",
559             PASS_REAL_ARG_FIXED_RET(lround, long));
560
561         PRINT("nearbyint",
562             PASS_REAL_ARG_REAL_RET(nearbyint));
563
564         PRINT("nextafter",
565             PASS_REAL_REAL_ARG_REAL_RET(nextafter));
566
567         PRINT("nexttoward",
568             PASS_REAL_FIXED_ARG_REAL_RET(nexttoward, 1) &&
569             PASS_REAL_FIXED_ARG_REAL_RET(nexttoward, ull) &&
570             PASS_REAL_FIXED_ARG_REAL_RET(nexttoward, d) &&
571             PASS_REAL_FIXED_ARG_REAL_RET(nexttoward, fc));
572
573         PRINT("remainder",
574             PASS_REAL_REAL_ARG_REAL_RET(remainder));
575
576         PRINT("remquo",
577             PASS_REAL_REAL_FIXED_ARG_REAL_RET(remquo, &i));
578
579         PRINT("rint",
580             PASS_REAL_ARG_REAL_RET(rint));
581
582         PRINT("round",
583             PASS_REAL_ARG_REAL_RET(round));
584
585         PRINT("scalbn",
586             PASS_REAL_FIXED_ARG_REAL_RET(scalbn, 1) &&
587             PASS_REAL_FIXED_ARG_REAL_RET(scalbn, b) &&
588             PASS_REAL_FIXED_ARG_REAL_RET(scalbn, I));
589
590         PRINT("scalbln",
591             PASS_REAL_FIXED_ARG_REAL_RET(scalbln, i) &&
592             PASS_REAL_FIXED_ARG_REAL_RET(scalbln, 1.l) &&
593             PASS_REAL_FIXED_ARG_REAL_RET(scalbln, dc));
594
595         PRINT("tgamma",
596             PASS_REAL_ARG_REAL_RET(tgamma));
597
598         PRINT("trunc",
599             PASS_REAL_ARG_REAL_RET(trunc));
600
601         /* 7.22#6 */
602         PRINT("carg",
603             PASS_REAL_ARG_REAL_RET_(carg, _complex) &&
604             PASS_COMPLEX_ARG_REAL_RET(carg));
605
606         PRINT("cimag",
607             PASS_REAL_ARG_REAL_RET_(cimag, _complex) &&
608             PASS_COMPLEX_ARG_REAL_RET(cimag));
609
610         PRINT("conj",
611             PASS_REAL_ARG_COMPLEX_RET(conj) &&
612             PASS_COMPLEX_ARG_COMPLEX_RET(conj));
613
614         PRINT("cproj",
615             PASS_REAL_ARG_COMPLEX_RET(cproj) &&
616             PASS_COMPLEX_ARG_COMPLEX_RET(cproj));
617
618         PRINT("creal",
619             PASS_REAL_ARG_REAL_RET_(creal, _complex) &&
620             PASS_COMPLEX_ARG_REAL_RET(creal));
621 }