]>
Commit | Line | Data |
---|---|---|
4f2689f4 | 1 | /* Test compilation of tgmath macros. |
2b778ceb | 2 | Copyright (C) 2001-2021 Free Software Foundation, Inc. |
4f2689f4 UD |
3 | This file is part of the GNU C Library. |
4 | Contributed by Jakub Jelinek <jakub@redhat.com> and | |
5 | Ulrich Drepper <drepper@redhat.com>, 2001. | |
6 | ||
7 | The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
8 | modify it under the terms of the GNU Lesser General Public |
9 | License as published by the Free Software Foundation; either | |
10 | version 2.1 of the License, or (at your option) any later version. | |
4f2689f4 UD |
11 | |
12 | The GNU C Library is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 15 | Lesser General Public License for more details. |
4f2689f4 | 16 | |
41bdb6e2 | 17 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 18 | License along with the GNU C Library; if not, see |
5a82c748 | 19 | <https://www.gnu.org/licenses/>. */ |
4f2689f4 UD |
20 | |
21 | #ifndef HAVE_MAIN | |
51737193 | 22 | #include <float.h> |
4f2689f4 | 23 | #include <math.h> |
423c2b9d | 24 | #include <stdint.h> |
4f2689f4 UD |
25 | #include <stdio.h> |
26 | #include <tgmath.h> | |
27 | ||
deea1b29 | 28 | //#define DEBUG |
4f2689f4 UD |
29 | |
30 | static void compile_test (void); | |
31 | static void compile_testf (void); | |
51737193 | 32 | #if LDBL_MANT_DIG > DBL_MANT_DIG |
4f2689f4 | 33 | static void compile_testl (void); |
53de11ad | 34 | #endif |
4f2689f4 UD |
35 | |
36 | float fx; | |
37 | double dx; | |
38 | long double lx; | |
1c298d08 UD |
39 | const float fy = 1.25; |
40 | const double dy = 1.25; | |
41 | const long double ly = 1.25; | |
42 | complex float fz; | |
43 | complex double dz; | |
44 | complex long double lz; | |
4f2689f4 | 45 | |
da796524 SL |
46 | volatile int count_double; |
47 | volatile int count_float; | |
48 | volatile int count_ldouble; | |
49 | volatile int count_cdouble; | |
50 | volatile int count_cfloat; | |
51 | volatile int count_cldouble; | |
4f2689f4 | 52 | |
42760d76 | 53 | #define NCALLS 132 |
304d7abf | 54 | #define NCALLS_INT 4 |
1c298d08 | 55 | #define NCCALLS 47 |
4f2689f4 | 56 | |
0035851c AS |
57 | static int |
58 | do_test (void) | |
4f2689f4 UD |
59 | { |
60 | int result = 0; | |
61 | ||
62 | count_float = count_double = count_ldouble = 0; | |
1c298d08 | 63 | count_cfloat = count_cdouble = count_cldouble = 0; |
4f2689f4 | 64 | compile_test (); |
1c298d08 | 65 | if (count_float != 0 || count_cfloat != 0) |
4f2689f4 UD |
66 | { |
67 | puts ("float function called for double test"); | |
68 | result = 1; | |
69 | } | |
1c298d08 | 70 | if (count_ldouble != 0 || count_cldouble != 0) |
4f2689f4 UD |
71 | { |
72 | puts ("long double function called for double test"); | |
73 | result = 1; | |
74 | } | |
304d7abf | 75 | if (count_double < NCALLS + NCALLS_INT) |
4f2689f4 UD |
76 | { |
77 | printf ("double functions not called often enough (%d)\n", | |
78 | count_double); | |
79 | result = 1; | |
80 | } | |
304d7abf | 81 | else if (count_double > NCALLS + NCALLS_INT) |
4f2689f4 UD |
82 | { |
83 | printf ("double functions called too often (%d)\n", | |
84 | count_double); | |
85 | result = 1; | |
86 | } | |
1c298d08 UD |
87 | if (count_cdouble < NCCALLS) |
88 | { | |
89 | printf ("double complex functions not called often enough (%d)\n", | |
90 | count_cdouble); | |
91 | result = 1; | |
92 | } | |
93 | else if (count_cdouble > NCCALLS) | |
94 | { | |
95 | printf ("double complex functions called too often (%d)\n", | |
96 | count_cdouble); | |
97 | result = 1; | |
98 | } | |
4f2689f4 UD |
99 | |
100 | count_float = count_double = count_ldouble = 0; | |
1c298d08 | 101 | count_cfloat = count_cdouble = count_cldouble = 0; |
4f2689f4 | 102 | compile_testf (); |
1c298d08 | 103 | if (count_double != 0 || count_cdouble != 0) |
4f2689f4 UD |
104 | { |
105 | puts ("double function called for float test"); | |
106 | result = 1; | |
107 | } | |
1c298d08 | 108 | if (count_ldouble != 0 || count_cldouble != 0) |
4f2689f4 UD |
109 | { |
110 | puts ("long double function called for float test"); | |
111 | result = 1; | |
112 | } | |
113 | if (count_float < NCALLS) | |
114 | { | |
115 | printf ("float functions not called often enough (%d)\n", count_float); | |
116 | result = 1; | |
117 | } | |
118 | else if (count_float > NCALLS) | |
119 | { | |
120 | printf ("float functions called too often (%d)\n", | |
121 | count_double); | |
122 | result = 1; | |
123 | } | |
1c298d08 UD |
124 | if (count_cfloat < NCCALLS) |
125 | { | |
126 | printf ("float complex functions not called often enough (%d)\n", | |
127 | count_cfloat); | |
128 | result = 1; | |
129 | } | |
130 | else if (count_cfloat > NCCALLS) | |
131 | { | |
132 | printf ("float complex functions called too often (%d)\n", | |
133 | count_cfloat); | |
134 | result = 1; | |
135 | } | |
4f2689f4 | 136 | |
51737193 | 137 | #if LDBL_MANT_DIG > DBL_MANT_DIG |
4f2689f4 | 138 | count_float = count_double = count_ldouble = 0; |
1c298d08 | 139 | count_cfloat = count_cdouble = count_cldouble = 0; |
4f2689f4 | 140 | compile_testl (); |
1c298d08 | 141 | if (count_float != 0 || count_cfloat != 0) |
4f2689f4 UD |
142 | { |
143 | puts ("float function called for long double test"); | |
144 | result = 1; | |
145 | } | |
1c298d08 | 146 | if (count_double != 0 || count_cdouble != 0) |
4f2689f4 UD |
147 | { |
148 | puts ("double function called for long double test"); | |
149 | result = 1; | |
150 | } | |
151 | if (count_ldouble < NCALLS) | |
152 | { | |
153 | printf ("long double functions not called often enough (%d)\n", | |
154 | count_ldouble); | |
155 | result = 1; | |
156 | } | |
157 | else if (count_ldouble > NCALLS) | |
158 | { | |
159 | printf ("long double functions called too often (%d)\n", | |
160 | count_double); | |
161 | result = 1; | |
162 | } | |
1c298d08 UD |
163 | if (count_cldouble < NCCALLS) |
164 | { | |
165 | printf ("long double complex functions not called often enough (%d)\n", | |
166 | count_cldouble); | |
167 | result = 1; | |
168 | } | |
169 | else if (count_cldouble > NCCALLS) | |
170 | { | |
171 | printf ("long double complex functions called too often (%d)\n", | |
172 | count_cldouble); | |
173 | result = 1; | |
174 | } | |
4f2689f4 UD |
175 | #endif |
176 | ||
177 | return result; | |
178 | } | |
179 | ||
180 | /* Now generate the three functions. */ | |
181 | #define HAVE_MAIN | |
182 | ||
183 | #define F(name) name | |
184 | #define TYPE double | |
304d7abf | 185 | #define TEST_INT 1 |
4f2689f4 | 186 | #define x dx |
1c298d08 UD |
187 | #define y dy |
188 | #define z dz | |
4f2689f4 | 189 | #define count count_double |
1c298d08 | 190 | #define ccount count_cdouble |
4f2689f4 UD |
191 | #include "test-tgmath.c" |
192 | ||
193 | #define F(name) name##f | |
194 | #define TYPE float | |
195 | #define x fx | |
1c298d08 UD |
196 | #define y fy |
197 | #define z fz | |
4f2689f4 | 198 | #define count count_float |
1c298d08 | 199 | #define ccount count_cfloat |
4f2689f4 UD |
200 | #include "test-tgmath.c" |
201 | ||
51737193 | 202 | #if LDBL_MANT_DIG > DBL_MANT_DIG |
4f2689f4 UD |
203 | #define F(name) name##l |
204 | #define TYPE long double | |
205 | #define x lx | |
1c298d08 UD |
206 | #define y ly |
207 | #define z lz | |
4f2689f4 | 208 | #define count count_ldouble |
1c298d08 | 209 | #define ccount count_cldouble |
4f2689f4 UD |
210 | #include "test-tgmath.c" |
211 | #endif | |
212 | ||
0035851c AS |
213 | #define TEST_FUNCTION do_test () |
214 | #include "../test-skeleton.c" | |
215 | ||
4f2689f4 UD |
216 | #else |
217 | ||
218 | #ifdef DEBUG | |
219 | #define P() puts (__FUNCTION__) | |
220 | #else | |
221 | #define P() | |
222 | #endif | |
223 | ||
224 | static void | |
225 | F(compile_test) (void) | |
226 | { | |
ee6bf14d | 227 | TYPE a, b, c = 1.0; |
1c298d08 | 228 | complex TYPE d; |
423c2b9d | 229 | int i = 2; |
1c298d08 | 230 | int saved_count; |
4f2689f4 UD |
231 | long int j; |
232 | long long int k; | |
423c2b9d JM |
233 | intmax_t m; |
234 | uintmax_t um; | |
4f2689f4 UD |
235 | |
236 | a = cos (cos (x)); | |
237 | b = acos (acos (a)); | |
238 | a = sin (sin (x)); | |
239 | b = asin (asin (a)); | |
240 | a = tan (tan (x)); | |
241 | b = atan (atan (a)); | |
242 | c = atan2 (atan2 (a, c), atan2 (b, x)); | |
243 | a = cosh (cosh (x)); | |
244 | b = acosh (acosh (a)); | |
245 | a = sinh (sinh (x)); | |
246 | b = asinh (asinh (a)); | |
247 | a = tanh (tanh (x)); | |
248 | b = atanh (atanh (a)); | |
249 | a = exp (exp (x)); | |
250 | b = log (log (a)); | |
251 | a = log10 (log10 (x)); | |
252 | b = ldexp (ldexp (a, 1), 5); | |
253 | a = frexp (frexp (x, &i), &i); | |
254 | b = expm1 (expm1 (a)); | |
255 | a = log1p (log1p (x)); | |
256 | b = logb (logb (a)); | |
257 | a = exp2 (exp2 (x)); | |
258 | b = log2 (log2 (a)); | |
259 | a = pow (pow (x, a), pow (c, b)); | |
260 | b = sqrt (sqrt (a)); | |
261 | a = hypot (hypot (x, b), hypot (c, a)); | |
262 | b = cbrt (cbrt (a)); | |
263 | a = ceil (ceil (x)); | |
264 | b = fabs (fabs (a)); | |
265 | a = floor (floor (x)); | |
266 | b = fmod (fmod (a, b), fmod (c, x)); | |
267 | a = nearbyint (nearbyint (x)); | |
268 | b = round (round (a)); | |
41c67149 | 269 | c = roundeven (roundeven (a)); |
4f2689f4 UD |
270 | a = trunc (trunc (x)); |
271 | b = remquo (remquo (a, b, &i), remquo (c, x, &i), &i); | |
272 | j = lrint (x) + lround (a); | |
273 | k = llrint (b) + llround (c); | |
423c2b9d JM |
274 | m = fromfp (a, FP_INT_UPWARD, 2) + fromfpx (b, FP_INT_DOWNWARD, 3); |
275 | um = ufromfp (c, FP_INT_TONEAREST, 4) + ufromfpx (a, FP_INT_TOWARDZERO, 5); | |
4f2689f4 UD |
276 | a = erf (erf (x)); |
277 | b = erfc (erfc (a)); | |
278 | a = tgamma (tgamma (x)); | |
279 | b = lgamma (lgamma (a)); | |
280 | a = rint (rint (x)); | |
281 | b = nextafter (nextafter (a, b), nextafter (c, x)); | |
41a359e2 RS |
282 | a = nextdown (nextdown (a)); |
283 | b = nexttoward (nexttoward (x, a), c); | |
284 | a = nextup (nextup (a)); | |
4f2689f4 UD |
285 | b = remainder (remainder (a, b), remainder (c, x)); |
286 | a = scalb (scalb (x, a), (TYPE) (6)); | |
287 | k = scalbn (a, 7) + scalbln (c, 10l); | |
288 | i = ilogb (x); | |
55a38f82 | 289 | j = llogb (x); |
4f2689f4 UD |
290 | a = fdim (fdim (x, a), fdim (c, b)); |
291 | b = fmax (fmax (a, x), fmax (c, b)); | |
292 | a = fmin (fmin (x, a), fmin (c, b)); | |
525f8039 JM |
293 | b = fmaxmag (fmaxmag (a, x), fmaxmag (c, b)); |
294 | a = fminmag (fminmag (x, a), fminmag (c, b)); | |
4f2689f4 | 295 | b = fma (sin (a), sin (x), sin (c)); |
304d7abf UD |
296 | |
297 | #ifdef TEST_INT | |
298 | a = atan2 (i, b); | |
299 | b = remquo (i, a, &i); | |
300 | c = fma (i, b, i); | |
301 | a = pow (i, c); | |
302 | #endif | |
423c2b9d | 303 | x = a + b + c + i + j + k + m + um; |
1c298d08 UD |
304 | |
305 | saved_count = count; | |
306 | if (ccount != 0) | |
307 | ccount = -10000; | |
308 | ||
309 | d = cos (cos (z)); | |
310 | z = acos (acos (d)); | |
311 | d = sin (sin (z)); | |
312 | z = asin (asin (d)); | |
313 | d = tan (tan (z)); | |
314 | z = atan (atan (d)); | |
315 | d = cosh (cosh (z)); | |
316 | z = acosh (acosh (d)); | |
317 | d = sinh (sinh (z)); | |
318 | z = asinh (asinh (d)); | |
319 | d = tanh (tanh (z)); | |
320 | z = atanh (atanh (d)); | |
321 | d = exp (exp (z)); | |
322 | z = log (log (d)); | |
323 | d = sqrt (sqrt (z)); | |
324 | z = conj (conj (d)); | |
325 | d = fabs (conj (a)); | |
326 | z = pow (pow (a, d), pow (b, z)); | |
327 | d = cproj (cproj (z)); | |
328 | z += fabs (cproj (a)); | |
329 | a = carg (carg (z)); | |
330 | b = creal (creal (d)); | |
331 | c = cimag (cimag (z)); | |
332 | x += a + b + c + i + j + k; | |
333 | z += d; | |
334 | ||
335 | if (saved_count != count) | |
336 | count = -10000; | |
337 | ||
338 | if (0) | |
339 | { | |
340 | a = cos (y); | |
341 | a = acos (y); | |
342 | a = sin (y); | |
343 | a = asin (y); | |
344 | a = tan (y); | |
345 | a = atan (y); | |
346 | a = atan2 (y, y); | |
347 | a = cosh (y); | |
348 | a = acosh (y); | |
349 | a = sinh (y); | |
350 | a = asinh (y); | |
351 | a = tanh (y); | |
352 | a = atanh (y); | |
353 | a = exp (y); | |
354 | a = log (y); | |
355 | a = log10 (y); | |
356 | a = ldexp (y, 5); | |
357 | a = frexp (y, &i); | |
358 | a = expm1 (y); | |
359 | a = log1p (y); | |
360 | a = logb (y); | |
361 | a = exp2 (y); | |
362 | a = log2 (y); | |
363 | a = pow (y, y); | |
364 | a = sqrt (y); | |
365 | a = hypot (y, y); | |
366 | a = cbrt (y); | |
367 | a = ceil (y); | |
368 | a = fabs (y); | |
369 | a = floor (y); | |
370 | a = fmod (y, y); | |
371 | a = nearbyint (y); | |
372 | a = round (y); | |
41c67149 | 373 | a = roundeven (y); |
1c298d08 UD |
374 | a = trunc (y); |
375 | a = remquo (y, y, &i); | |
376 | j = lrint (y) + lround (y); | |
377 | k = llrint (y) + llround (y); | |
423c2b9d JM |
378 | m = fromfp (y, FP_INT_UPWARD, 6) + fromfpx (y, FP_INT_DOWNWARD, 7); |
379 | um = (ufromfp (y, FP_INT_TONEAREST, 8) | |
380 | + ufromfpx (y, FP_INT_TOWARDZERO, 9)); | |
1c298d08 UD |
381 | a = erf (y); |
382 | a = erfc (y); | |
383 | a = tgamma (y); | |
384 | a = lgamma (y); | |
385 | a = rint (y); | |
386 | a = nextafter (y, y); | |
387 | a = nexttoward (y, y); | |
388 | a = remainder (y, y); | |
389 | a = scalb (y, (const TYPE) (6)); | |
390 | k = scalbn (y, 7) + scalbln (y, 10l); | |
391 | i = ilogb (y); | |
55a38f82 | 392 | j = llogb (y); |
1c298d08 UD |
393 | a = fdim (y, y); |
394 | a = fmax (y, y); | |
395 | a = fmin (y, y); | |
525f8039 JM |
396 | a = fmaxmag (y, y); |
397 | a = fminmag (y, y); | |
1c298d08 UD |
398 | a = fma (y, y, y); |
399 | ||
400 | #ifdef TEST_INT | |
401 | a = atan2 (i, y); | |
402 | a = remquo (i, y, &i); | |
403 | a = fma (i, y, i); | |
404 | a = pow (i, y); | |
405 | #endif | |
406 | ||
407 | d = cos ((const complex TYPE) z); | |
408 | d = acos ((const complex TYPE) z); | |
409 | d = sin ((const complex TYPE) z); | |
410 | d = asin ((const complex TYPE) z); | |
411 | d = tan ((const complex TYPE) z); | |
412 | d = atan ((const complex TYPE) z); | |
413 | d = cosh ((const complex TYPE) z); | |
414 | d = acosh ((const complex TYPE) z); | |
415 | d = sinh ((const complex TYPE) z); | |
416 | d = asinh ((const complex TYPE) z); | |
417 | d = tanh ((const complex TYPE) z); | |
418 | d = atanh ((const complex TYPE) z); | |
419 | d = exp ((const complex TYPE) z); | |
420 | d = log ((const complex TYPE) z); | |
421 | d = sqrt ((const complex TYPE) z); | |
422 | d = pow ((const complex TYPE) z, (const complex TYPE) z); | |
423 | d = fabs ((const complex TYPE) z); | |
424 | d = carg ((const complex TYPE) z); | |
425 | d = creal ((const complex TYPE) z); | |
426 | d = cimag ((const complex TYPE) z); | |
427 | d = conj ((const complex TYPE) z); | |
428 | d = cproj ((const complex TYPE) z); | |
429 | } | |
4f2689f4 UD |
430 | } |
431 | #undef x | |
1c298d08 UD |
432 | #undef y |
433 | #undef z | |
4f2689f4 UD |
434 | |
435 | ||
436 | TYPE | |
437 | (F(cos)) (TYPE x) | |
438 | { | |
439 | ++count; | |
1c298d08 | 440 | P (); |
4f2689f4 UD |
441 | return x; |
442 | } | |
443 | ||
444 | TYPE | |
445 | (F(acos)) (TYPE x) | |
446 | { | |
447 | ++count; | |
1c298d08 | 448 | P (); |
4f2689f4 UD |
449 | return x; |
450 | } | |
451 | ||
452 | TYPE | |
453 | (F(sin)) (TYPE x) | |
454 | { | |
455 | ++count; | |
1c298d08 | 456 | P (); |
4f2689f4 UD |
457 | return x; |
458 | } | |
459 | ||
460 | TYPE | |
461 | (F(asin)) (TYPE x) | |
462 | { | |
463 | ++count; | |
1c298d08 | 464 | P (); |
4f2689f4 UD |
465 | return x; |
466 | } | |
467 | ||
468 | TYPE | |
469 | (F(tan)) (TYPE x) | |
470 | { | |
471 | ++count; | |
1c298d08 | 472 | P (); |
4f2689f4 UD |
473 | return x; |
474 | } | |
475 | ||
476 | TYPE | |
477 | (F(atan)) (TYPE x) | |
478 | { | |
479 | ++count; | |
1c298d08 | 480 | P (); |
4f2689f4 UD |
481 | return x; |
482 | } | |
483 | ||
484 | TYPE | |
485 | (F(atan2)) (TYPE x, TYPE y) | |
486 | { | |
487 | ++count; | |
1c298d08 | 488 | P (); |
4f2689f4 UD |
489 | return x + y; |
490 | } | |
491 | ||
492 | TYPE | |
493 | (F(cosh)) (TYPE x) | |
494 | { | |
495 | ++count; | |
1c298d08 | 496 | P (); |
4f2689f4 UD |
497 | return x; |
498 | } | |
499 | ||
500 | TYPE | |
501 | (F(acosh)) (TYPE x) | |
502 | { | |
503 | ++count; | |
1c298d08 | 504 | P (); |
4f2689f4 UD |
505 | return x; |
506 | } | |
507 | ||
508 | TYPE | |
509 | (F(sinh)) (TYPE x) | |
510 | { | |
511 | ++count; | |
1c298d08 | 512 | P (); |
4f2689f4 UD |
513 | return x; |
514 | } | |
515 | ||
516 | TYPE | |
517 | (F(asinh)) (TYPE x) | |
518 | { | |
519 | ++count; | |
1c298d08 | 520 | P (); |
4f2689f4 UD |
521 | return x; |
522 | } | |
523 | ||
524 | TYPE | |
525 | (F(tanh)) (TYPE x) | |
526 | { | |
527 | ++count; | |
1c298d08 | 528 | P (); |
4f2689f4 UD |
529 | return x; |
530 | } | |
531 | ||
532 | TYPE | |
533 | (F(atanh)) (TYPE x) | |
534 | { | |
535 | ++count; | |
1c298d08 | 536 | P (); |
4f2689f4 UD |
537 | return x; |
538 | } | |
539 | ||
540 | TYPE | |
541 | (F(exp)) (TYPE x) | |
542 | { | |
543 | ++count; | |
1c298d08 | 544 | P (); |
4f2689f4 UD |
545 | return x; |
546 | } | |
547 | ||
548 | TYPE | |
549 | (F(log)) (TYPE x) | |
550 | { | |
551 | ++count; | |
1c298d08 | 552 | P (); |
4f2689f4 UD |
553 | return x; |
554 | } | |
555 | ||
556 | TYPE | |
557 | (F(log10)) (TYPE x) | |
558 | { | |
559 | ++count; | |
1c298d08 | 560 | P (); |
4f2689f4 UD |
561 | return x; |
562 | } | |
563 | ||
564 | TYPE | |
565 | (F(ldexp)) (TYPE x, int y) | |
566 | { | |
567 | ++count; | |
1c298d08 UD |
568 | P (); |
569 | return x + y; | |
4f2689f4 UD |
570 | } |
571 | ||
572 | TYPE | |
573 | (F(frexp)) (TYPE x, int *y) | |
574 | { | |
575 | ++count; | |
1c298d08 UD |
576 | P (); |
577 | return x + *y; | |
4f2689f4 UD |
578 | } |
579 | ||
580 | TYPE | |
581 | (F(expm1)) (TYPE x) | |
582 | { | |
583 | ++count; | |
1c298d08 | 584 | P (); |
4f2689f4 UD |
585 | return x; |
586 | } | |
587 | ||
588 | TYPE | |
589 | (F(log1p)) (TYPE x) | |
590 | { | |
591 | ++count; | |
1c298d08 | 592 | P (); |
4f2689f4 UD |
593 | return x; |
594 | } | |
595 | ||
596 | TYPE | |
597 | (F(logb)) (TYPE x) | |
598 | { | |
599 | ++count; | |
1c298d08 | 600 | P (); |
4f2689f4 UD |
601 | return x; |
602 | } | |
603 | ||
604 | TYPE | |
605 | (F(exp2)) (TYPE x) | |
606 | { | |
607 | ++count; | |
1c298d08 | 608 | P (); |
4f2689f4 UD |
609 | return x; |
610 | } | |
611 | ||
612 | TYPE | |
613 | (F(log2)) (TYPE x) | |
614 | { | |
615 | ++count; | |
1c298d08 | 616 | P (); |
4f2689f4 UD |
617 | return x; |
618 | } | |
619 | ||
620 | TYPE | |
621 | (F(pow)) (TYPE x, TYPE y) | |
622 | { | |
623 | ++count; | |
1c298d08 | 624 | P (); |
4f2689f4 UD |
625 | return x + y; |
626 | } | |
627 | ||
628 | TYPE | |
629 | (F(sqrt)) (TYPE x) | |
630 | { | |
631 | ++count; | |
1c298d08 | 632 | P (); |
4f2689f4 UD |
633 | return x; |
634 | } | |
635 | ||
636 | TYPE | |
637 | (F(hypot)) (TYPE x, TYPE y) | |
638 | { | |
639 | ++count; | |
1c298d08 | 640 | P (); |
4f2689f4 UD |
641 | return x + y; |
642 | } | |
643 | ||
644 | TYPE | |
645 | (F(cbrt)) (TYPE x) | |
646 | { | |
647 | ++count; | |
1c298d08 | 648 | P (); |
4f2689f4 UD |
649 | return x; |
650 | } | |
651 | ||
652 | TYPE | |
653 | (F(ceil)) (TYPE x) | |
654 | { | |
655 | ++count; | |
1c298d08 | 656 | P (); |
4f2689f4 UD |
657 | return x; |
658 | } | |
659 | ||
660 | TYPE | |
661 | (F(fabs)) (TYPE x) | |
662 | { | |
663 | ++count; | |
1c298d08 | 664 | P (); |
4f2689f4 UD |
665 | return x; |
666 | } | |
667 | ||
668 | TYPE | |
669 | (F(floor)) (TYPE x) | |
670 | { | |
671 | ++count; | |
1c298d08 | 672 | P (); |
4f2689f4 UD |
673 | return x; |
674 | } | |
675 | ||
676 | TYPE | |
677 | (F(fmod)) (TYPE x, TYPE y) | |
678 | { | |
679 | ++count; | |
1c298d08 | 680 | P (); |
4f2689f4 UD |
681 | return x + y; |
682 | } | |
683 | ||
684 | TYPE | |
685 | (F(nearbyint)) (TYPE x) | |
686 | { | |
687 | ++count; | |
1c298d08 | 688 | P (); |
4f2689f4 UD |
689 | return x; |
690 | } | |
691 | ||
692 | TYPE | |
693 | (F(round)) (TYPE x) | |
694 | { | |
695 | ++count; | |
1c298d08 | 696 | P (); |
4f2689f4 UD |
697 | return x; |
698 | } | |
699 | ||
41c67149 JM |
700 | TYPE |
701 | (F(roundeven)) (TYPE x) | |
702 | { | |
703 | ++count; | |
704 | P (); | |
705 | return x; | |
706 | } | |
707 | ||
4f2689f4 UD |
708 | TYPE |
709 | (F(trunc)) (TYPE x) | |
710 | { | |
711 | ++count; | |
1c298d08 | 712 | P (); |
4f2689f4 UD |
713 | return x; |
714 | } | |
715 | ||
716 | TYPE | |
717 | (F(remquo)) (TYPE x, TYPE y, int *i) | |
718 | { | |
719 | ++count; | |
1c298d08 UD |
720 | P (); |
721 | return x + y + *i; | |
4f2689f4 UD |
722 | } |
723 | ||
724 | long int | |
725 | (F(lrint)) (TYPE x) | |
726 | { | |
727 | ++count; | |
1c298d08 | 728 | P (); |
4f2689f4 UD |
729 | return x; |
730 | } | |
731 | ||
732 | long int | |
733 | (F(lround)) (TYPE x) | |
734 | { | |
735 | ++count; | |
1c298d08 | 736 | P (); |
4f2689f4 UD |
737 | return x; |
738 | } | |
739 | ||
740 | long long int | |
741 | (F(llrint)) (TYPE x) | |
742 | { | |
743 | ++count; | |
1c298d08 | 744 | P (); |
4f2689f4 UD |
745 | return x; |
746 | } | |
747 | ||
748 | long long int | |
749 | (F(llround)) (TYPE x) | |
750 | { | |
751 | ++count; | |
1c298d08 | 752 | P (); |
4f2689f4 UD |
753 | return x; |
754 | } | |
755 | ||
423c2b9d JM |
756 | intmax_t |
757 | (F(fromfp)) (TYPE x, int round, unsigned int width) | |
758 | { | |
759 | ++count; | |
760 | P (); | |
761 | return x; | |
762 | } | |
763 | ||
764 | intmax_t | |
765 | (F(fromfpx)) (TYPE x, int round, unsigned int width) | |
766 | { | |
767 | ++count; | |
768 | P (); | |
769 | return x; | |
770 | } | |
771 | ||
772 | uintmax_t | |
773 | (F(ufromfp)) (TYPE x, int round, unsigned int width) | |
774 | { | |
775 | ++count; | |
776 | P (); | |
777 | return x; | |
778 | } | |
779 | ||
780 | uintmax_t | |
781 | (F(ufromfpx)) (TYPE x, int round, unsigned int width) | |
782 | { | |
783 | ++count; | |
784 | P (); | |
785 | return x; | |
786 | } | |
787 | ||
4f2689f4 UD |
788 | TYPE |
789 | (F(erf)) (TYPE x) | |
790 | { | |
791 | ++count; | |
1c298d08 | 792 | P (); |
4f2689f4 UD |
793 | return x; |
794 | } | |
795 | ||
796 | TYPE | |
797 | (F(erfc)) (TYPE x) | |
798 | { | |
799 | ++count; | |
1c298d08 | 800 | P (); |
4f2689f4 UD |
801 | return x; |
802 | } | |
803 | ||
804 | TYPE | |
805 | (F(tgamma)) (TYPE x) | |
806 | { | |
807 | ++count; | |
1c298d08 | 808 | P (); |
4f2689f4 UD |
809 | return x; |
810 | } | |
811 | ||
812 | TYPE | |
813 | (F(lgamma)) (TYPE x) | |
814 | { | |
815 | ++count; | |
1c298d08 | 816 | P (); |
4f2689f4 UD |
817 | return x; |
818 | } | |
819 | ||
820 | TYPE | |
821 | (F(rint)) (TYPE x) | |
822 | { | |
823 | ++count; | |
1c298d08 | 824 | P (); |
4f2689f4 UD |
825 | return x; |
826 | } | |
827 | ||
828 | TYPE | |
829 | (F(nextafter)) (TYPE x, TYPE y) | |
830 | { | |
831 | ++count; | |
1c298d08 | 832 | P (); |
4f2689f4 UD |
833 | return x + y; |
834 | } | |
835 | ||
41a359e2 RS |
836 | TYPE |
837 | (F(nextdown)) (TYPE x) | |
838 | { | |
839 | ++count; | |
840 | P (); | |
841 | return x; | |
842 | } | |
843 | ||
4f2689f4 UD |
844 | TYPE |
845 | (F(nexttoward)) (TYPE x, long double y) | |
846 | { | |
847 | ++count; | |
1c298d08 UD |
848 | P (); |
849 | return x + y; | |
4f2689f4 UD |
850 | } |
851 | ||
41a359e2 RS |
852 | TYPE |
853 | (F(nextup)) (TYPE x) | |
854 | { | |
855 | ++count; | |
856 | P (); | |
857 | return x; | |
858 | } | |
859 | ||
4f2689f4 UD |
860 | TYPE |
861 | (F(remainder)) (TYPE x, TYPE y) | |
862 | { | |
863 | ++count; | |
1c298d08 | 864 | P (); |
4f2689f4 UD |
865 | return x + y; |
866 | } | |
867 | ||
868 | TYPE | |
869 | (F(scalb)) (TYPE x, TYPE y) | |
870 | { | |
871 | ++count; | |
1c298d08 | 872 | P (); |
4f2689f4 UD |
873 | return x + y; |
874 | } | |
875 | ||
876 | TYPE | |
877 | (F(scalbn)) (TYPE x, int y) | |
878 | { | |
879 | ++count; | |
1c298d08 UD |
880 | P (); |
881 | return x + y; | |
4f2689f4 UD |
882 | } |
883 | ||
884 | TYPE | |
885 | (F(scalbln)) (TYPE x, long int y) | |
886 | { | |
887 | ++count; | |
1c298d08 UD |
888 | P (); |
889 | return x + y; | |
4f2689f4 UD |
890 | } |
891 | ||
892 | int | |
893 | (F(ilogb)) (TYPE x) | |
894 | { | |
895 | ++count; | |
1c298d08 | 896 | P (); |
4f2689f4 UD |
897 | return x; |
898 | } | |
899 | ||
55a38f82 JM |
900 | long int |
901 | (F(llogb)) (TYPE x) | |
902 | { | |
903 | ++count; | |
904 | P (); | |
905 | return x; | |
906 | } | |
907 | ||
4f2689f4 UD |
908 | TYPE |
909 | (F(fdim)) (TYPE x, TYPE y) | |
910 | { | |
911 | ++count; | |
1c298d08 | 912 | P (); |
4f2689f4 UD |
913 | return x + y; |
914 | } | |
915 | ||
916 | TYPE | |
917 | (F(fmin)) (TYPE x, TYPE y) | |
918 | { | |
919 | ++count; | |
1c298d08 | 920 | P (); |
4f2689f4 UD |
921 | return x + y; |
922 | } | |
923 | ||
924 | TYPE | |
925 | (F(fmax)) (TYPE x, TYPE y) | |
525f8039 JM |
926 | { |
927 | ++count; | |
928 | P (); | |
929 | return x + y; | |
930 | } | |
931 | ||
932 | TYPE | |
933 | (F(fminmag)) (TYPE x, TYPE y) | |
934 | { | |
935 | ++count; | |
936 | P (); | |
937 | return x + y; | |
938 | } | |
939 | ||
940 | TYPE | |
941 | (F(fmaxmag)) (TYPE x, TYPE y) | |
4f2689f4 UD |
942 | { |
943 | ++count; | |
1c298d08 | 944 | P (); |
4f2689f4 UD |
945 | return x + y; |
946 | } | |
947 | ||
948 | TYPE | |
949 | (F(fma)) (TYPE x, TYPE y, TYPE z) | |
950 | { | |
951 | ++count; | |
1c298d08 | 952 | P (); |
4f2689f4 UD |
953 | return x + y + z; |
954 | } | |
955 | ||
1c298d08 UD |
956 | complex TYPE |
957 | (F(cacos)) (complex TYPE x) | |
958 | { | |
959 | ++ccount; | |
960 | P (); | |
961 | return x; | |
962 | } | |
963 | ||
964 | complex TYPE | |
965 | (F(casin)) (complex TYPE x) | |
966 | { | |
967 | ++ccount; | |
968 | P (); | |
969 | return x; | |
970 | } | |
971 | ||
972 | complex TYPE | |
973 | (F(catan)) (complex TYPE x) | |
974 | { | |
975 | ++ccount; | |
976 | P (); | |
977 | return x; | |
978 | } | |
979 | ||
980 | complex TYPE | |
981 | (F(ccos)) (complex TYPE x) | |
982 | { | |
983 | ++ccount; | |
984 | P (); | |
985 | return x; | |
986 | } | |
987 | ||
988 | complex TYPE | |
989 | (F(csin)) (complex TYPE x) | |
990 | { | |
991 | ++ccount; | |
992 | P (); | |
993 | return x; | |
994 | } | |
995 | ||
996 | complex TYPE | |
997 | (F(ctan)) (complex TYPE x) | |
998 | { | |
999 | ++ccount; | |
1000 | P (); | |
1001 | return x; | |
1002 | } | |
1003 | ||
1004 | complex TYPE | |
1005 | (F(cacosh)) (complex TYPE x) | |
1006 | { | |
1007 | ++ccount; | |
1008 | P (); | |
1009 | return x; | |
1010 | } | |
1011 | ||
1012 | complex TYPE | |
1013 | (F(casinh)) (complex TYPE x) | |
1014 | { | |
1015 | ++ccount; | |
1016 | P (); | |
1017 | return x; | |
1018 | } | |
1019 | ||
1020 | complex TYPE | |
1021 | (F(catanh)) (complex TYPE x) | |
1022 | { | |
1023 | ++ccount; | |
1024 | P (); | |
1025 | return x; | |
1026 | } | |
1027 | ||
1028 | complex TYPE | |
1029 | (F(ccosh)) (complex TYPE x) | |
1030 | { | |
1031 | ++ccount; | |
1032 | P (); | |
1033 | return x; | |
1034 | } | |
1035 | ||
1036 | complex TYPE | |
1037 | (F(csinh)) (complex TYPE x) | |
1038 | { | |
1039 | ++ccount; | |
1040 | P (); | |
1041 | return x; | |
1042 | } | |
1043 | ||
1044 | complex TYPE | |
1045 | (F(ctanh)) (complex TYPE x) | |
1046 | { | |
1047 | ++ccount; | |
1048 | P (); | |
1049 | return x; | |
1050 | } | |
1051 | ||
1052 | complex TYPE | |
1053 | (F(cexp)) (complex TYPE x) | |
1054 | { | |
1055 | ++ccount; | |
1056 | P (); | |
1057 | return x; | |
1058 | } | |
1059 | ||
1060 | complex TYPE | |
1061 | (F(clog)) (complex TYPE x) | |
1062 | { | |
1063 | ++ccount; | |
1064 | P (); | |
1065 | return x; | |
1066 | } | |
1067 | ||
1068 | complex TYPE | |
1069 | (F(csqrt)) (complex TYPE x) | |
1070 | { | |
1071 | ++ccount; | |
1072 | P (); | |
1073 | return x; | |
1074 | } | |
1075 | ||
1076 | complex TYPE | |
1077 | (F(cpow)) (complex TYPE x, complex TYPE y) | |
1078 | { | |
1079 | ++ccount; | |
1080 | P (); | |
1081 | return x + y; | |
1082 | } | |
1083 | ||
1084 | TYPE | |
1085 | (F(cabs)) (complex TYPE x) | |
1086 | { | |
1087 | ++ccount; | |
1088 | P (); | |
1089 | return x; | |
1090 | } | |
1091 | ||
1092 | TYPE | |
1093 | (F(carg)) (complex TYPE x) | |
1094 | { | |
1095 | ++ccount; | |
1096 | P (); | |
1097 | return x; | |
1098 | } | |
1099 | ||
1100 | TYPE | |
1101 | (F(creal)) (complex TYPE x) | |
1102 | { | |
1103 | ++ccount; | |
1104 | P (); | |
1105 | return __real__ x; | |
1106 | } | |
1107 | ||
1108 | TYPE | |
1109 | (F(cimag)) (complex TYPE x) | |
1110 | { | |
1111 | ++ccount; | |
1112 | P (); | |
1113 | return __imag__ x; | |
1114 | } | |
1115 | ||
1116 | complex TYPE | |
1117 | (F(conj)) (complex TYPE x) | |
1118 | { | |
1119 | ++ccount; | |
1120 | P (); | |
1121 | return x; | |
1122 | } | |
1123 | ||
1124 | complex TYPE | |
1125 | (F(cproj)) (complex TYPE x) | |
1126 | { | |
1127 | ++ccount; | |
1128 | P (); | |
1129 | return x; | |
1130 | } | |
1131 | ||
4f2689f4 UD |
1132 | #undef F |
1133 | #undef TYPE | |
1134 | #undef count | |
1c298d08 | 1135 | #undef ccount |
304d7abf | 1136 | #undef TEST_INT |
4f2689f4 | 1137 | #endif |