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