! { dg-do run } ! PR 20131: We used to read past the end of a line, especially for ! standard input. program main character(len=8) c1,c2 open(77,file="foo.dat") write(77,'(A)') 'Line 1','Line 2','Line 3' close(77) open(5,file="foo.dat") read (5,'(A)') c1,c2 if (c2 .ne. 'Line 2') call abort end program main