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