./:
[official-gcc.git] / gcc / testsuite / gfortran.dg / read_eor.f90
blobf3327550297791c9167f36de2315ad9afbc50e11
1 ! { dg-do run }
2 ! PR24489 Assure that read does not go past the end of record. The width of
3 ! the format specifier is 8, but the internal unit record length is 4 so only
4 ! the first 4 characters should be read.
5 ! Contributed by Jerry DeLisle <jvdelisle@verizon.net>.
6 program pr24489
7 character*4, dimension(8) :: abuf = (/"0123","4567","89AB","CDEF", &
8 "0123","4567","89AB","CDEF"/)
9 character*4, dimension(2,4) :: buf
10 character*8 :: a
11 equivalence (buf,abuf)
12 read(buf, '(a8)') a
13 if (a.ne.'0123') call abort()
14 end program pr24489