2 ! { dg-options "-fdec" }
4 ! Test that we get a run-time warning for close-on-delete with READONLY,
5 ! and that the file is protected from deletion.
11 character(*), parameter :: f
= "dec_io_6.txt"
14 open(unit
=fd
,file
=f
,action
='write')
17 open(unit
=fd
,file
=f
,action
='read',readonly)
18 close(unit
=fd
,status
='delete') ! { dg-output "file protected by READONLY" }
20 inquire(file
=f
, EXIST
=exists
)
21 if (.not
. exists
) then
22 print *, 'file was not protected by READONLY!'
26 open(unit
=fd
,file
=f
,action
='write')
27 close(unit
=fd
,status
='delete') ! cleanup