diff mbox

Fortran testsuite fix from Francois

Message ID 20160114143518.GK3017@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Jan. 14, 2016, 2:35 p.m. UTC
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.


	Jakub

Comments

Jeff Law Jan. 14, 2016, 5:36 p.m. UTC | #1
On 01/14/2016 07:35 AM, Jakub Jelinek wrote:
> 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.
OK.
jeff
Paul Richard Thomas Jan. 14, 2016, 6:13 p.m. UTC | #2
Dear Jakub,

Thanks for that. OK by me too.

Paul

On 14 January 2016 at 18:36, Jeff Law <law@redhat.com> wrote:
> On 01/14/2016 07:35 AM, Jakub Jelinek wrote:
>>
>> 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.
>
> OK.
> jeff
>
diff mbox

Patch

--- 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