[PATCH] Fortran testsuite fix from Francois

Jakub Jelinek jakub@redhat.com
Thu Jan 14 14:35:00 GMT 2016


Hi!

I've bootstrapped/regtested on x86_64-linux and i686-linux the following fix
from Francois that has been sitting in the PR for a few months.
The problem is that the testcase assumed that the last real_kind
has maximum precision and maximum range.  That is usually the case,
but is not the case with the insane double double format, which has
LDBL_MIN > DBL_MIN.
The intention is to test the behavior with too large precisions or ranges,
100 times the max precision or range safely hits that case.

Ok for trunk?

2016-01-14  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR testsuite/67509
	* gfortran.dg/ieee/ieee_7.f90: For out of bound precision or
	range tests use 100 * maximum instead of maximum + 1.

--- gcc/testsuite/gfortran.dg/ieee/ieee_7.f90.jj	2015-08-24 18:26:54.000000000 +0200
+++ gcc/testsuite/gfortran.dg/ieee/ieee_7.f90	2016-01-13 19:34:19.614644333 +0100
@@ -33,8 +33,8 @@
   end if
 
   if (ieee_selected_real_kind(0,0,3) /= -5) call abort
-  if (ieee_selected_real_kind(precision(0._maxreal)+1) /= -1) call abort
-  if (ieee_selected_real_kind(0,range(0._maxreal)+1) /= -2) call abort
-  if (ieee_selected_real_kind(precision(0._maxreal)+1,range(0._maxreal)+1) /= -3) call abort
+  if (ieee_selected_real_kind(100*precision(0._maxreal)) /= -1) call abort
+  if (ieee_selected_real_kind(0,100*range(0._maxreal)) /= -2) call abort
+  if (ieee_selected_real_kind(100*precision(0._maxreal),100*range(0._maxreal)) /= -3) call abort
 
 end

	Jakub



More information about the Gcc-patches mailing list