blob: bbcf46b72a6ad59af77e8086fb80a2e6fb5d46bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
! { dg-do run }
! PR48618 - Negative unit number in OPEN(...) is sometimes allowed
!
! Test originally from Janne Blomqvist in PR:
! http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48618
program nutest
implicit none
logical l
integer id, ios
open(newunit=id, file="foo.txt", iostat=ios)
if (ios /= 0) call abort
open(id, file="bar.txt", iostat=ios)
if (ios /= 0) call abort
close(id, status="delete")
open(unit=10, file="foo.txt", status="old", iostat=ios)
if (ios /= 0) call abort
close(10, status="delete")
open(-10, file="foo.txt", iostat=ios)
if (ios == 0) call abort
inquire(file="foo.txt", exist=l)
if (l) call abort
end program nutest
|