]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/test-tgmath.c
Improve the accuracy of tgamma (BZ #26983)
[thirdparty/glibc.git] / math / test-tgmath.c
index de9073dcf2e1c26527b5e36d707771d5105cc3db..21af8c9502824f280032d883352c5e2d6d73f492 100644 (file)
@@ -1,5 +1,5 @@
 /* Test compilation of tgmath macros.
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com> and
    Ulrich Drepper <drepper@redhat.com>, 2001.
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef HAVE_MAIN
-#undef __NO_MATH_INLINES
-#define __NO_MATH_INLINES 1
+#include <float.h>
 #include <math.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -30,7 +29,7 @@
 
 static void compile_test (void);
 static void compile_testf (void);
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
 static void compile_testl (void);
 #endif
 
@@ -44,14 +43,14 @@ complex float fz;
 complex double dz;
 complex long double lz;
 
-int count_double;
-int count_float;
-int count_ldouble;
-int count_cdouble;
-int count_cfloat;
-int count_cldouble;
+volatile int count_double;
+volatile int count_float;
+volatile int count_ldouble;
+volatile int count_cdouble;
+volatile int count_cfloat;
+volatile int count_cldouble;
 
-#define NCALLS     138
+#define NCALLS     132
 #define NCALLS_INT 4
 #define NCCALLS    47
 
@@ -135,7 +134,7 @@ do_test (void)
       result = 1;
     }
 
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
   count_float = count_double = count_ldouble = 0;
   count_cfloat = count_cdouble = count_cldouble = 0;
   compile_testl ();
@@ -200,7 +199,7 @@ do_test (void)
 #define ccount count_cfloat
 #include "test-tgmath.c"
 
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
 #define F(name) name##l
 #define TYPE long double
 #define x lx
@@ -294,8 +293,6 @@ F(compile_test) (void)
   b = fmaxmag (fmaxmag (a, x), fmaxmag (c, b));
   a = fminmag (fminmag (x, a), fminmag (c, b));
   b = fma (sin (a), sin (x), sin (c));
-  a = totalorder (totalorder (x, b), totalorder (c, x));
-  b = totalordermag (totalordermag (x, a), totalordermag (c, x));
 
 #ifdef TEST_INT
   a = atan2 (i, b);
@@ -399,8 +396,6 @@ F(compile_test) (void)
       a = fmaxmag (y, y);
       a = fminmag (y, y);
       a = fma (y, y, y);
-      a = totalorder (y, y);
-      a = totalordermag (y, y);
 
 #ifdef TEST_INT
       a = atan2 (i, y);
@@ -958,22 +953,6 @@ TYPE
   return x + y + z;
 }
 
-int
-(F(totalorder)) (TYPE x, TYPE y)
-{
-  ++count;
-  P ();
-  return x + y;
-}
-
-int
-(F(totalordermag)) (TYPE x, TYPE y)
-{
-  ++count;
-  P ();
-  return x + y;
-}
-
 complex TYPE
 (F(cacos)) (complex TYPE x)
 {