aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/read_list_eof_1.f9022
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dc35df3..d1469b6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-18 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR libfortran/48296
+ * gfortran.dg/read_list_eof_1.f90: New test.
+
2011-06-18 Jakub Jelinek <jakub@redhat.com>
PR target/49411
diff --git a/gcc/testsuite/gfortran.dg/read_list_eof_1.f90 b/gcc/testsuite/gfortran.dg/read_list_eof_1.f90
new file mode 100644
index 0000000..775346e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/read_list_eof_1.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! PR 49296 List formatted read of file without EOR marker (\n).
+program read_list_eof_1
+ implicit none
+ character(len=100) :: s
+ call genfil ()
+ open (unit=20, file='read.dat', form='FORMATTED', action='READ', &
+ status='OLD')
+ read (20, fmt=*) s
+ close (20, status='delete')
+ if (trim(s) /= "a") then
+ call abort ()
+ end if
+
+contains
+ subroutine genfil
+ open(10, file='read.dat', form='unformatted', action='write', &
+ status='replace', access='stream')
+ write(10) 'a'
+ close(10)
+ end subroutine genfil
+end program read_list_eof_1