Patchwork [Fortran,Committed] PR testsuite/56082 / PR fortran/56304 (libquad) Test-case fixes

login
register
mail settings
Submitter Tobias Burnus
Date Feb. 13, 2013, 12:06 p.m.
Message ID <511B81AC.1060909@net-b.de>
Download mbox | patch
Permalink /patch/220126/
State New
Headers show

Comments

Tobias Burnus - Feb. 13, 2013, 12:06 p.m.
I have committed a fix for PR 56082, where the test case assumed that 
C_Bool is a byte wide (kind=1); however, on 32bit Darwin, C_Bool is by 
default an "int" (kind=4) – hence, a warning is not printed. The change 
was to use logical(kind=2) for the example, assuming C_Bool is never kind=2.
Committed as http://gcc.gnu.org/viewcvs?view=revision&revision=195984

For PR 56204, the test case assumed that I/O uses by default the same 
rounding for input and output. That worked well, except on Solaris – 
well, using an epsilon criterion is also fine. Patched by the attached 
patch. (Committed as Rev. 196011.)

Tobias
Janus Weil - Feb. 13, 2013, 2:18 p.m.
Hi Tobias,

since you're fixing test cases: What about PR 55852 comment 10?


"The test case fails because the match is too strict.

$ grep iszs intrinsic_size_3.f90.003t.original
  integer(kind=2) iszs;
          iszs = (integer(kind=2)) MAX_EXPR <(D.854->dim[0].ubound -
D.854->dim[0].lbound) + 1, 0>;"


You were the who committed this test case. Could you have a look?

Thanks,
Janus



2013/2/13 Tobias Burnus <burnus@net-b.de>:
> I have committed a fix for PR 56082, where the test case assumed that C_Bool
> is a byte wide (kind=1); however, on 32bit Darwin, C_Bool is by default an
> "int" (kind=4) – hence, a warning is not printed. The change was to use
> logical(kind=2) for the example, assuming C_Bool is never kind=2.
> Committed as http://gcc.gnu.org/viewcvs?view=revision&revision=195984
>
> For PR 56204, the test case assumed that I/O uses by default the same
> rounding for input and output. That worked well, except on Solaris – well,
> using an epsilon criterion is also fine. Patched by the attached patch.
> (Committed as Rev. 196011.)
>
> Tobias

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(Revision 196010)
+++ ChangeLog	(Arbeitskopie)
@@ -1,3 +1,10 @@ 
+2013-02-13  Tobias Burnus  <burnus@net-b.de>
+	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	PR fortran/56204
+	* gfortran.dg/quad_2.f90: Use "< epsilon" instead of "==".
+	* gfortran.dg/quad_3.f90: Ditto.
+
 2013-02-13  Kostya Serebryany  <kcc@google.com>
 
 	* c-c++-common/asan/strncpy-overflow-1.c: Update the test
@@ -20,7 +27,7 @@ 
 2013-02-12  Dominique d'Humieres  <dominiq@lps.ens.fr>
 	    Tobias Burnus  <burnus@net-b.de>
 
-	PR fortran/56082
+	PR testsuite/56082
 	* gfortran.dg/bind_c_bool_1.f90 (sub): Change kind=4
 	to kind=2.
 
Index: gfortran.dg/quad_2.f90
===================================================================
--- gfortran.dg/quad_2.f90	(Revision 196010)
+++ gfortran.dg/quad_2.f90	(Arbeitskopie)
@@ -31,9 +31,9 @@ 
    read (str2, *) fp3
    if (fp1 /= fp3) call abort()
    read (str3, *) fp4
-   if (fp2 /= fp4) call abort()
+   if (abs (fp2 - fp4)/fp2 > epsilon(fp2)) call abort()
    read (str4, *) fp4
-   if (fp2 /= fp4) call abort()
+   if (abs (fp2 - fp4)/fp2 > epsilon(fp2)) call abort()
 
    select case (qp)
      case (8)
Index: gfortran.dg/quad_3.f90
===================================================================
--- gfortran.dg/quad_3.f90	(Revision 196010)
+++ gfortran.dg/quad_3.f90	(Arbeitskopie)
@@ -25,6 +25,7 @@ 
      read (tmp, *) a, c
 !     print *, 'same value read again:   ', a, c
 !     print *, 'difference: looks OK now ', a-b(1)
-     if (a-b(1) /= 0.0_qp .or. c-b(1) /= 0.0_qp) call abort()
+     if (abs (a-b(1))/a > epsilon(0.0_qp) &
+         .or. abs (c-b(1))/c > epsilon (0.0_qp)) call abort()
    end if
 end program test_qp