From 5226f481de8d22202ad8fdd8a117725cb4c8d4b7 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Wed, 26 Jul 2006 01:47:13 +0000 Subject: [PATCH] re PR fortran/28335 (flush() / write() statement on closed units - error?) 2006-07-25 Jerry DeLisle PR libgfortran/28335 * gfortran.dg/no_unit_error_1.f90: New test. * gfortran.dg/no_unit_error_2.f90: New test. * gfortran.dg/temporary_1.f90: Remove extraneous CLOSE. From-SVN: r115750 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gfortran.dg/no_unit_error_1.f90 | 7 +++++++ gcc/testsuite/gfortran.dg/no_unit_error_2.f90 | 7 +++++++ gcc/testsuite/gfortran.dg/temporary_1.f90 | 1 - 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/no_unit_error_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/no_unit_error_2.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 63aadaf8e28..26a25b9680b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2006-07-25 Jerry DeLisle + + PR libgfortran/28335 + * gfortran.dg/no_unit_error_1.f90: New test. + * gfortran.dg/no_unit_error_2.f90: New test. + * gfortran.dg/temporary_1.f90: Remove extraneous CLOSE. + 2006-07-25 Roger Sayle PR middle-end/28473 diff --git a/gcc/testsuite/gfortran.dg/no_unit_error_1.f90 b/gcc/testsuite/gfortran.dg/no_unit_error_1.f90 new file mode 100644 index 00000000000..fea2875988d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/no_unit_error_1.f90 @@ -0,0 +1,7 @@ +! { dg-do run } +! { dg-shouldfail "UNIT is not open before CLOSE" } +! PR28335 Check for error on no unit. + close(88) ! { dg-output "Can't find specified UNIT in CLOSE" } + end + + diff --git a/gcc/testsuite/gfortran.dg/no_unit_error_2.f90 b/gcc/testsuite/gfortran.dg/no_unit_error_2.f90 new file mode 100644 index 00000000000..595191f9edf --- /dev/null +++ b/gcc/testsuite/gfortran.dg/no_unit_error_2.f90 @@ -0,0 +1,7 @@ +! { dg-do run } +! { dg-shouldfail "UNIT is not open before FLUSH" } +! PR28335 Check for error on no unit. + flush(88) ! { dg-output "Can't find specified UNIT in FLUSH" } + end + + diff --git a/gcc/testsuite/gfortran.dg/temporary_1.f90 b/gcc/testsuite/gfortran.dg/temporary_1.f90 index e255efdb7a8..7bdf08d2984 100644 --- a/gcc/testsuite/gfortran.dg/temporary_1.f90 +++ b/gcc/testsuite/gfortran.dg/temporary_1.f90 @@ -15,7 +15,6 @@ program pr27662 if (x (i, j) .ne. z (i, j)) call abort () end do end do - close (10) contains function test () result (res)