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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [append_1.f90] - Rev 801

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

! PR libfortran/21471
! Testing POSITION="APPEND"
!
! { dg-do run }
      subroutine failed
        close (10,status='delete')
        call abort
      end subroutine failed

      integer,parameter :: n = 13
      integer :: i, j, error

      open (10, file='foo')
      close (10)

      do i = 1, n
        open (10, file='foo',position='append')
        write (10,*) i
        close (10)
      end do

      open (10,file='foo',status='old')
      error = 0
      i = -1
      do while (error == 0)
        i = i + 1
        read (10,*,iostat=error) j
        if (error == 0) then
          if (i + 1 /= j) call failed
        end if
        if (i > n + 1) call failed
      end do
      if (i /= n) call failed
      close (10,status='delete')
      end

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

powered by: WebSVN 2.1.0

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