diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2018-09-22 17:49:19 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2018-09-22 17:49:19 +0000 |
commit | 73a958c67e3c99e10724dc65c4cb738da6188e34 (patch) | |
tree | 0a60a11a95e575dff68217c4734e61773187321c | |
parent | 091a8640be4f26433c73257b381e1ac376713bff (diff) | |
download | gcc-73a958c67e3c99e10724dc65c4cb738da6188e34.zip gcc-73a958c67e3c99e10724dc65c4cb738da6188e34.tar.gz gcc-73a958c67e3c99e10724dc65c4cb738da6188e34.tar.bz2 |
re PR fortran/87318 (gfortran.dg/dtio_1.f90 is invalid)
2018-09-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/87318
* gfortran.dg/dtio_1.f90: Update test to valid code.
From-SVN: r264505
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/dtio_1.f90 | 19 |
2 files changed, 14 insertions, 10 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 78800e8..7afec4f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/87318 + * gfortran.dg/dtio_1.f90: Update test to valid code. + 2018-09-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/85603 diff --git a/gcc/testsuite/gfortran.dg/dtio_1.f90 b/gcc/testsuite/gfortran.dg/dtio_1.f90 index 7e5d166..c6f17d9 100644 --- a/gcc/testsuite/gfortran.dg/dtio_1.f90 +++ b/gcc/testsuite/gfortran.dg/dtio_1.f90 @@ -7,8 +7,8 @@ ! to control execution. ! 3) Tests parsing of the optional vlist, passing in and using it to ! generate a user defined format string. -! 4) Tests passing an iostat or iomsg out of libgfortranthe child procedure back to -! the parent. +! 4) Tests passing an iostat or iomsg out of the libgfortran child +! procedure back to the parent. ! MODULE p USE ISO_FORTRAN_ENV @@ -33,7 +33,6 @@ CONTAINS INTEGER :: myios udfmt='(*(g0))' - iomsg = "SUCCESS" iostat=0 if (iotype.eq."DT") then if (size(vlist).ne.0) print *, 36 @@ -64,6 +63,7 @@ CONTAINS if (iotype.eq."NAMELIST") then if (size(vlist).ne.0) print *, 59 iostat=6000 + iomsg = "NAMELIST not implemented in pwf" endif END SUBROUTINE pwf @@ -78,7 +78,6 @@ CONTAINS INTEGER :: myios real :: areal udfmt='(*(g0))' - iomsg = "SUCCESS" iostat=0 if (iotype.eq."DT") then if (size(vlist).ne.0) print *, 36 @@ -109,8 +108,8 @@ CONTAINS if (iotype.eq."NAMELIST") then if (size(vlist).ne.0) print *, 59 iostat=6000 + iomsg = "NAMELIST not implemented in prf" endif - !READ (UNIT = UNIT, FMT = *) dtv%name, dtv%age END SUBROUTINE prf END MODULE p @@ -126,12 +125,12 @@ PROGRAM test chairman%age=62 member%name="George" member%age=42 - astring = "FAILURE" + astring = "SUCCESS" write (10, "(DT'zeroth',3x, DT'three'(11,4,10),11x,DT'two'(8,2))", & & iostat=myiostat, iomsg=astring) member, chairman, member if (myiostat.ne.0) STOP 3 if (astring.ne."SUCCESS") STOP 4 - astring = "FAILURE" + astring = "SUCCESS" write (10, *, iostat=myiostat, iomsg=astring) member, chairman, member if (myiostat.ne.0) STOP 5 if (astring.ne."SUCCESS") STOP 6 @@ -141,7 +140,7 @@ PROGRAM test chairman%age=99 member%name="bogus2" member%age=66 - astring = "FAILURE" + astring = "SUCCESS" read(10,"(DT'zeroth',3x, DT'three'(11,4,10),11x,DT'two'(8,2))") member, chairman, member if (member%name.ne."George") STOP 7 if (chairman%name.ne." Charlie") STOP 8 @@ -151,12 +150,12 @@ PROGRAM test chairman%age=99 member%name="bogus2" member%age=66 - astring = "FAILURE" + astring = "SAME" read (10, *, iostat=myiostat, iomsg=astring) member, chairman, member ! The user defined procedure reads to the end of the line/file, then finalizing the parent ! reads past, so we wrote a blank line above. User needs to address these nuances in their ! procedures. (subject to interpretation) - if (astring.ne."SUCCESS") STOP 11 + if (astring.ne."SAME" .or. myiostat.ne.0) STOP 11 if (member%name.ne."George") STOP 12 if (chairman%name.ne."Charlie") STOP 13 if (member%age.ne.42) STOP 14 |