lto: Remove random_seed from section name.
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_io_6.f90
blob12bcbed0581ee604e30a2a325f7ebe1d6d97d216
1 ! { dg-do run }
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.
8 implicit none
10 integer :: fd = 8
11 character(*), parameter :: f = "dec_io_6.txt"
12 logical :: exists
14 open(unit=fd,file=f,action='write')
15 close(unit=fd)
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!'
23 STOP 1
24 endif
26 open(unit=fd,file=f,action='write')
27 close(unit=fd,status='delete') ! cleanup
29 end