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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [endfile.f90] - Blame information for rev 399

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run { target fd_truncate } }
2
! pr18364 endfile does not truncate file.
3
!   write out 20 records
4
!   rewind
5
!   read 10 records
6
!   endfile
7
!   close file
8
!   open file
9
!   detect file has only 10 records
10
      implicit none
11
      integer i,j
12
      open(unit=10,file='test.dat',access='sequential',status='replace')
13
      do i=1, 20
14
        write (10,'(I4)') i
15
      end do
16
      rewind(10)
17
      do i=1,10
18
        read (10,'(I4)') j
19
      end do
20
      endfile(10)
21
      close(10)
22
      open(unit=10,file='test.dat',access='sequential',status='old')
23
      do i=1,20
24
        read (10,'(I4)',end=99) j
25
      end do
26
      ! should never get here
27
      call abort
28
  99  continue ! end of file
29
      if (j.ne.10) call abort
30
      close(10,status='delete')
31
      end

powered by: WebSVN 2.1.0

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