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