]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: fix testcases
authorFrancois-Xavier Coudert <fxcoudert@gmail.com>
Mon, 3 Oct 2022 07:24:10 +0000 (09:24 +0200)
committerFrancois-Xavier Coudert <fxcoudert@gmail.com>
Mon, 3 Oct 2022 07:26:45 +0000 (09:26 +0200)
Remove unreliable test for IEEE_FMA(), which fails on powerpc.
Adjust stop codes for modes_1.f90.

2022-10-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

gcc/testsuite/

PR fortran/107062
* gfortran.dg/ieee/fma_1.f90: Fix test.
* gfortran.dg/ieee/modes_1.f90: Fix test.

gcc/testsuite/gfortran.dg/ieee/fma_1.f90
gcc/testsuite/gfortran.dg/ieee/modes_1.f90

index 34636426c98cee43b69274853556879b8a341448..320c73a0c3c6963e87a567e37636f1beafc0aea7 100644 (file)
@@ -38,7 +38,6 @@
   print *, sx1 * sx2 + sx3
   print *, ieee_fma(sx1, sx2, sx3)
   if (ieee_fma(sx1, sx2, sx3) /= real(3, kind(sx1)) / 2) stop 4
-  !if (ieee_fma(sx1, sx2, sx3) == sx1 * sx2 + sx3) stop 5
 
   ! Double
 
@@ -57,7 +56,6 @@
   print *, dx1 * dx2 + dx3
   print *, ieee_fma(dx1, dx2, dx3)
   if (ieee_fma(dx1, dx2, dx3) /= real(3, kind(dx1)) / 2) stop 4
-  !if (ieee_fma(dx1, dx2, dx3) == dx1 * dx2 + dx3) stop 5
 
   ! Large kind 1
 
@@ -76,7 +74,6 @@
   print *, lx1 * lx2 + lx3
   print *, ieee_fma(lx1, lx2, lx3)
   if (ieee_fma(lx1, lx2, lx3) /= real(3, kind(lx1)) / 2) stop 4
-  if (ieee_fma(lx1, lx2, lx3) == lx1 * lx2 + lx3) stop 5
 
   ! Large kind 2
 
@@ -95,6 +92,5 @@
   print *, wx1 * wx2 + wx3
   print *, ieee_fma(wx1, wx2, wx3)
   if (ieee_fma(wx1, wx2, wx3) /= real(3, kind(wx1)) / 2) stop 4
-  if (ieee_fma(wx1, wx2, wx3) == wx1 * wx2 + wx3) stop 5
 
 end
index b6ab28847f7f7f0fbf58220cc8b49794a5474535..205c47f38007d06116289c19d6b23cf3bf83bd48 100644 (file)
@@ -81,15 +81,15 @@ program foo
   ! Check again
   if (ieee_support_underflow_control()) then
     call ieee_get_underflow_mode(f)
-    if (.not. f) stop 3
+    if (.not. f) stop 4
   endif
   if (ieee_support_rounding(ieee_down)) then
     call ieee_get_rounding_mode(rmode)
-    if (rmode /= ieee_down) stop 4
+    if (rmode /= ieee_down) stop 5
   endif
   if (ieee_support_halting(ieee_overflow)) then
     call ieee_get_halting_mode(ieee_overflow, f)
-    if (f) stop 5
+    if (f) stop 6
   endif
 
 end program foo