PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / streamio_3.f90
blobd73e431a09fa6746c172d47eb69a8eabd44f4949
1 ! { dg-do run }
2 ! PR25828 Stream IO test 3, tests read_x and inquire.
3 ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>.
4 program streamio_3
5 implicit none
6 integer :: i(6),j
7 character(10) :: myaccess
8 open(10, access="stream", form="formatted")
9 i = (/(j,j=1,6)/)
10 write(10,'(3(2x,i4/)/3(3x,i6/))') i
11 i = 0
12 rewind(10)
13 read(10,'(3(2x,i4/)/3(3x,i6/))') i
14 if (any(i.ne.(/(j,j=1,6)/))) call abort()
15 inquire(unit=10, access=myaccess)
16 if (myaccess.ne."STREAM") call abort()
17 close(10,status="delete")
18 end program streamio_3