PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / open_negative_unit_1.f90
blob0bcd3b926171f5ebf65083931bfdc14d5676d05a
1 ! { dg-do run }
2 ! PR48618 - Negative unit number in OPEN(...) is sometimes allowed
4 ! Test originally from Janne Blomqvist in PR:
5 ! http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48618
7 program nutest
8 implicit none
9 logical l
10 integer id, ios
12 open(newunit=id, file="foo_open_negative_unit_1.txt", iostat=ios)
13 if (ios /= 0) STOP 1
15 open(id, file="bar.txt", iostat=ios)
16 if (ios /= 0) STOP 2
18 close(id, status="delete")
20 open(unit=10, file="foo_open_negative_unit_1.txt", status="old", iostat=ios)
21 if (ios /= 0) STOP 3
23 close(10, status="delete")
25 open(-10, file="foo_open_negative_unit_1.txt", iostat=ios)
26 if (ios == 0) STOP 4
28 inquire(file="foo_open_negative_unit_1.txt", exist=l)
29 if (l) STOP 5
30 end program nutest