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