Fix warnings occured during profiledboostrap on
[official-gcc.git] / gcc / testsuite / gfortran.dg / direct_io_7.f90
blobff116b0a109e98d16c2c8c4340ef9064a11b0c5b
1 ! { dg-do run }
2 ! PR 34405 - direct access prohibits ENDFILE, BACKSPACE and REWIND
3 program test
4 implicit none
5 integer :: ios
6 character(len=80) :: msg
7 open (95, access="direct", recl=4, status="scratch")
8 write (95,rec=1) 'abcd'
10 ios = 0
11 msg = " "
12 backspace (95,iostat=ios,iomsg=msg)
13 if (ios == 0 .or. &
14 msg /= "Cannot BACKSPACE a file opened for DIRECT access") call abort
16 ios = 0
17 msg = " "
18 endfile (95,iostat=ios,iomsg=msg)
19 if (ios == 0 .or. &
20 msg /= "Cannot perform ENDFILE on a file opened for DIRECT access") &
21 call abort
23 ios = 0
24 msg = " "
25 rewind (95,iostat=ios,iomsg=msg)
26 if (ios == 0 .or. &
27 msg /= "Cannot REWIND a file opened for DIRECT access ") call abort
29 close (95)
30 end program test