On Thu, Oct 27, 2016 at 8:16 AM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Thu, Oct 27, 2016 at 07:46:16AM -0400, Fritz Reese wrote:
>> > Shouldn't something also remove dec_io_5.txt file if it is created?
>> > Shall the (now xfailed, so not implemented yet?) runtime error terminate
>> > the program, or can it be also just deleted later on?  If not,
>> > we'll need some dg-final cleanup-target-file or something similar that will
>> > remote_file target delete the file (similarly to cleanup-modules etc.).
>> >
>> >         Jakub
>>
>> For dec_io_5, the program (intentionally) crashes because "ACTION
>> conflicts with READONLY" so dec_io_5.txt is never created.
>
> So why dec_io_6.f90 worked at all (if it ever worked)?
> And why the xfail when it works as expected?
>>
>> For dec_io_6, the "protected by READONLY" message is (intentionally) a
>> runtime warning and does not terminate the program, so the following
>> lines safely delete dec_io_6.txt.

The presence of "test.txt" in dec_io_6.f90 was an artifact of me using
the same "test.txt" file for all dec_io_1 through dec_io_5 in my own
private tests. Thus since "test.txt" already existed from my own tests
I didn't catch when I forgot to switch to "dec_io_6.txt" before
submitting. I had the XFAIL in because I thought the DG failure was
coming from the runtime warning. I guess the fail was actually
happening because "test.txt" didn't exist - now that I correctly
renamed it to "dec_io_6.txt" you are right and the XFAIL is erroneous.
I should actually use INQUIRE to check whether the file was deleted on
close (it should not be for READONLY).

Do you know if there is there any way from DG to verify that a runtime
warning is emitted?

---
Fritz Reese

From: Fritz Reese <fritzore...@gmail.com>
Date: Thu, 27 Oct 2016 08:46:33 -0400
Subject: [PATCH] Fix some DEC I/O testcases.

        gcc/testsuite/gfortran.dg/
        * dec_io_5.f90: Rename 'test.txt' to 'dec_io_5.txt'.
        * dec_io_6.f90: Use 'dec_io_6.txt' and INQUIRE instead of XFAIL.
---
 gcc/testsuite/gfortran.dg/dec_io_5.f90 |    2 +-
 gcc/testsuite/gfortran.dg/dec_io_6.f90 |   19 ++++++++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)

Reply via email to