From b1a807057ecb701601141285c011ef637b97f3b7 Mon Sep 17 00:00:00 2001 From: Bud Davis Date: Sat, 22 Jan 2005 03:51:12 +0000 Subject: re PR libfortran/19314 (inquire(position=) segfaults at runtime) 2004-01-22 Bud Davis PR fortran/19314 * io/inquire.c(inquire_via_unit): implement POSITION=. * io/transfer.c(next_record): update position for INQUIRE. * io/rewind.c(st_rewind): update position for INQUIRE. * gfortran.dg/inquire_5.f90: New test. From-SVN: r94060 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/inquire_5.f90 | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/inquire_5.f90 (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f764fdd..fb28b4b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-01-22 Bud Davis + + PR fortran/19314 + * gfortran.dg/inquire_5.f90: New test. + 2005-01-22 Volker Reichelt PR c/18809 diff --git a/gcc/testsuite/gfortran.dg/inquire_5.f90 b/gcc/testsuite/gfortran.dg/inquire_5.f90 new file mode 100644 index 0000000..0daa579 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/inquire_5.f90 @@ -0,0 +1,35 @@ +! { dg-do run } +! pr19314 inquire(..position=..) segfaults +! test by Thomas.Koenig@online.de +! bdavis9659@comcast.net + implicit none + character*20 chr + open(7,STATUS='SCRATCH') + inquire(7,position=chr) + if (chr.NE.'ASIS') CALL ABORT + close(7) + open(7,STATUS='SCRATCH',ACCESS='DIRECT',RECL=100) + inquire(7,position=chr) + if (chr.NE.'UNDEFINED') CALL ABORT + close(7) + open(7,STATUS='SCRATCH',POSITION='REWIND') + inquire(7,position=chr) + if (chr.NE.'REWIND') CALL ABORT + close(7) + open(7,STATUS='SCRATCH',POSITION='ASIS') + inquire(7,position=chr) + if (chr.NE.'ASIS') CALL ABORT + close(7) + open(7,STATUS='SCRATCH',POSITION='APPEND') + inquire(7,position=chr) + if (chr.NE.'APPEND') CALL ABORT + close(7) + open(7,STATUS='SCRATCH',POSITION='REWIND') + write(7,*)'this is a record written to the file' + inquire(7,position=chr) + if (chr.NE.'ASIS') CALL ABORT + rewind(7) + inquire(7,position=chr) + if (chr.NE.'REWIND') CALL ABORT + close(7) + end -- cgit v1.1