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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [streamio_4.f90] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! PR25828 Stream IO test 4, Tests string read and writes, single byte.
3
! Verifies buffering is working correctly and position="append"
4
! Contributed by Jerry DeLisle .
5
program streamtest
6
  implicit none
7
  character(1)   :: lf = char(10)
8
  character(1)   :: tchar
9
  integer        :: i,j,k
10
  integer, parameter :: lines = 5231
11
 
12
  open(10, file="teststream", access="stream", form="formatted")
13
 
14
  do i=1,lines
15
    do j=0,9
16
      write(10,"(i5)") j
17
    end do
18
  end do
19
 
20
  close(10)
21
 
22
  open(10, file="teststream", access="stream",&
23
  &form="formatted", position="append")
24
  do i=1,lines
25
    do j=0,9
26
      write(10,"(i5)") j
27
    end do
28
  end do
29
  rewind(10)
30
  do i=1,lines
31
    do j=0,9
32
      read(10,"(i5)") k
33
      if (k.ne.j) call abort()
34
    end do
35
  end do
36
 
37
  close(10,status="delete")
38
end program streamtest

powered by: WebSVN 2.1.0

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