2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / streamio_13.f90
blobe37535b7b6b12b892de944fe3edb537614f2f9f3
1 ! { dg-do run }
2 ! PR 34405 - BACKSPACE for unformatted stream files is prohibited.
3 program main
4 implicit none
5 integer :: ios
6 character(len=80) :: msg
7 open(2003,form="unformatted",access="stream",status="scratch")
8 write (2003) 1
9 write (2003) 2
10 ios = 0
11 msg = ' '
12 backspace (2003,iostat=ios,iomsg=msg)
13 if (ios == 0 .or. msg /="Cannot BACKSPACE an unformatted stream file") &
14 call abort
15 end program main