* gcc.dg/builtins-20.c: Use fabs, not __builtin_fabs.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Nov 2006 14:42:19 +0000 (14:42 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Nov 2006 14:42:19 +0000 (14:42 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118621 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtins-20.c

index 6931a7b..93da32f 100644 (file)
@@ -1,3 +1,7 @@
+2006-11-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * gcc.dg/builtins-20.c: Use fabs, not __builtin_fabs.
+
 2006-11-09  Tobias Burnus  <burnus@net-b.de>
 
        * gfortran.dg/io_constraints_3.f90: Fixed by using -fmax-errors.
index d4161d1..0c6736c 100644 (file)
 extern double cos (double);
 extern double sin (double);
 extern double tan (double);
+extern double fabs (double);
 extern double hypot (double, double);
 extern double pure (double) __attribute__ ((__pure__));
 extern float cosf (float);
 extern float sinf (float);
 extern float tanf (float);
+extern float fabsf (float);
 extern float hypotf (float, float);
 extern float puref (float) __attribute__ ((__pure__));
 extern long double cosl (long double);
 extern long double sinl (long double);
 extern long double tanl (long double);
+extern long double fabsl (long double);
 extern long double hypotl (long double, long double);
 extern long double purel (long double) __attribute__ ((__pure__));
 
@@ -62,13 +65,13 @@ void test2(double x, double y)
   if (-sin(x-y) != sin(y-x))
     link_error ();
 
-  if (hypot (x, 0) != __builtin_fabs(x))
+  if (hypot (x, 0) != fabs(x))
     link_error ();
 
-  if (hypot (0, x) != __builtin_fabs(x))
+  if (hypot (0, x) != fabs(x))
     link_error ();
 
-  if (hypot (x, x) != __builtin_fabs(x) * __builtin_sqrt(2))
+  if (hypot (x, x) != fabs(x) * __builtin_sqrt(2))
     link_error ();
 
   if (hypot (-x, y) != hypot (x, y))
@@ -80,27 +83,25 @@ void test2(double x, double y)
   if (hypot (-x, -y) != hypot (x, y))
     link_error ();
 
-  if (hypot (__builtin_fabs(x), y) != hypot (x, y))
+  if (hypot (fabs(x), y) != hypot (x, y))
     link_error ();
 
-  if (hypot (x, __builtin_fabs(y)) != hypot (x, y))
+  if (hypot (x, fabs(y)) != hypot (x, y))
     link_error ();
 
-  if (hypot (__builtin_fabs(x), __builtin_fabs(y)) != hypot (x, y))
+  if (hypot (fabs(x), fabs(y)) != hypot (x, y))
     link_error ();
 
-  if (hypot (-__builtin_fabs(-x),
-            -__builtin_fabs(__builtin_fabs(__builtin_fabs(-y))))
-      != hypot (x, y))
+  if (hypot (-fabs(-x), -fabs(fabs(fabs(-y)))) != hypot (x, y))
     link_error ();
 
-  if (hypot (-x, 0) != __builtin_fabs(x))
+  if (hypot (-x, 0) != fabs(x))
     link_error ();
 
-  if (hypot (-x, x) != __builtin_fabs(x) * __builtin_sqrt(2))
+  if (hypot (-x, x) != fabs(x) * __builtin_sqrt(2))
     link_error ();
 
-  if (hypot (pure(x), -pure(x)) != __builtin_fabs(pure(x)) * __builtin_sqrt(2))
+  if (hypot (pure(x), -pure(x)) != fabs(pure(x)) * __builtin_sqrt(2))
     link_error ();
 }
 
@@ -138,13 +139,13 @@ void test2f(float x, float y)
   if (-sinf(x-y) != sinf(y-x))
     link_error ();
 
-  if (hypotf (x, 0) != __builtin_fabsf(x))
+  if (hypotf (x, 0) != fabsf(x))
     link_error ();
 
-  if (hypotf (0, x) != __builtin_fabsf(x))
+  if (hypotf (0, x) != fabsf(x))
     link_error ();
 
-  if (hypotf (x, x) != __builtin_fabsf(x) * __builtin_sqrtf(2))
+  if (hypotf (x, x) != fabsf(x) * __builtin_sqrtf(2))
     link_error ();
 
   if (hypotf (-x, y) != hypotf (x, y))
@@ -156,27 +157,25 @@ void test2f(float x, float y)
   if (hypotf (-x, -y) != hypotf (x, y))
     link_error ();
 
-  if (hypotf (__builtin_fabsf(x), y) != hypotf (x, y))
+  if (hypotf (fabsf(x), y) != hypotf (x, y))
     link_error ();
 
-  if (hypotf (x, __builtin_fabsf(y)) != hypotf (x, y))
+  if (hypotf (x, fabsf(y)) != hypotf (x, y))
     link_error ();
 
-  if (hypotf (__builtin_fabsf(x), __builtin_fabsf(y)) != hypotf (x, y))
+  if (hypotf (fabsf(x), fabsf(y)) != hypotf (x, y))
     link_error ();
 
-  if (hypotf (-__builtin_fabsf(-x),
-             -__builtin_fabsf(__builtin_fabsf(__builtin_fabsf(-y))))
-      != hypotf (x, y))
+  if (hypotf (-fabsf(-x), -fabsf(fabsf(fabsf(-y)))) != hypotf (x, y))
     link_error ();
 
-  if (hypotf (-x, 0) != __builtin_fabsf(x))
+  if (hypotf (-x, 0) != fabsf(x))
     link_error ();
 
-  if (hypotf (-x, x) != __builtin_fabsf(x) * __builtin_sqrtf(2))
+  if (hypotf (-x, x) != fabsf(x) * __builtin_sqrtf(2))
     link_error ();
 
-  if (hypotf (puref(x), -puref(x)) != __builtin_fabsf(puref(x)) * __builtin_sqrtf(2))
+  if (hypotf (puref(x), -puref(x)) != fabsf(puref(x)) * __builtin_sqrtf(2))
     link_error ();
 }
 
@@ -215,13 +214,13 @@ void test2l(long double x, long double y)
   if (-sinl(x-y) != sinl(y-x))
     link_error ();
 
-  if (hypotl (x, 0) != __builtin_fabsl(x))
+  if (hypotl (x, 0) != fabsl(x))
     link_error ();
 
-  if (hypotl (0, x) != __builtin_fabsl(x))
+  if (hypotl (0, x) != fabsl(x))
     link_error ();
 
-  if (hypotl (x, x) != __builtin_fabsl(x) * __builtin_sqrtl(2))
+  if (hypotl (x, x) != fabsl(x) * __builtin_sqrtl(2))
     link_error ();
 
   if (hypotl (-x, y) != hypotl (x, y))
@@ -233,27 +232,25 @@ void test2l(long double x, long double y)
   if (hypotl (-x, -y) != hypotl (x, y))
     link_error ();
 
-  if (hypotl (__builtin_fabsl(x), y) != hypotl (x, y))
+  if (hypotl (fabsl(x), y) != hypotl (x, y))
     link_error ();
 
-  if (hypotl (x, __builtin_fabsl(y)) != hypotl (x, y))
+  if (hypotl (x, fabsl(y)) != hypotl (x, y))
     link_error ();
 
-  if (hypotl (__builtin_fabsl(x), __builtin_fabsl(y)) != hypotl (x, y))
+  if (hypotl (fabsl(x), fabsl(y)) != hypotl (x, y))
     link_error ();
 
-  if (hypotl (-__builtin_fabsl(-x),
-             -__builtin_fabsl(__builtin_fabsl(__builtin_fabsl(-y))))
-      != hypotl (x, y))
+  if (hypotl (-fabsl(-x), -fabsl(fabsl(fabsl(-y)))) != hypotl (x, y))
     link_error ();
 
-  if (hypotl (-x, 0) != __builtin_fabsl(x))
+  if (hypotl (-x, 0) != fabsl(x))
     link_error ();
 
-  if (hypotl (-x, x) != __builtin_fabsl(x) * __builtin_sqrtl(2))
+  if (hypotl (-x, x) != fabsl(x) * __builtin_sqrtl(2))
     link_error ();
 
-  if (hypotl (purel(x), -purel(x)) != __builtin_fabsl(purel(x)) * __builtin_sqrtl(2))
+  if (hypotl (purel(x), -purel(x)) != fabsl(purel(x)) * __builtin_sqrtl(2))
     link_error ();
 }