OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [read_eof_8.f90] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR43265: See comment #26 in the PR.  Before patch,
3
! the test case would fail to read the last line of the file.
4
! Thanks to Jean-Baptiste Faure for providing the initial test case.
5
program test
6
  character (len=6) :: line
7
  integer :: n, k=0
8
  open(unit=25,file="test.dat",status="replace", &
9
       & form="unformatted", access="stream")
10
  write(25) "Line 1" // char(10)
11
  write(25) "Line 2" // char(10)
12
  write(25) "Line 3" // char(10)
13
  write(25) "Line 4" // char(10)
14
  write(25) "Line 5" ! No EOR marker on the last line.
15
  close(25, status="keep")
16
  open(25, file="test.dat", status="old")
17
  do n=1,10
18
   read(25,'(a)',end=100,err=101) line
19
   k = k+1
20
  enddo
21
  call abort
22
100 if (k /= 5) call abort
23
  stop
24
101 call abort
25
end program test
26
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.