OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / negative_unit_int8.f
1 ! { dg-do run }
2 ! { dg-options "-fdefault-integer-8" }
3
4 ! NOTE: This test is identical to negative_unit.f except -fdefault-integer-8
5 !
6 ! PR libfortran/20660 and other bugs (not filed in bugzilla) relating
7 ! to negative units
8 ! PR 33055 Runtime error in INQUIRE unit existance with -fdefault-integer-8
9 ! Test case update by Jerry DeLisle <jvdelisle@gcc.gnu.org>
10 !
11 ! Bugs submitted by Walt Brainerd
12       integer i
13       integer, parameter ::ERROR_BAD_UNIT = 5005
14       logical l
15       
16       i = -1
17 ! gfortran created a 'fort.-1' file and wrote "Hello" in it
18       write (unit=i, fmt=*, iostat=i) "Hello"
19       if (i <= 0) call abort
20       
21       i = -11
22       open (unit=i, file="xxx", iostat=i)
23       if (i <= 0) call abort
24
25       i = -42
26       inquire (unit=i, exist=l)
27       if (l) call abort
28
29       i = 2_8*huge(0_4)+20_8
30 ! This one is nasty
31       inquire (unit=i, exist=l, iostat=i)
32       if (l) call abort
33       if (i.ne.ERROR_BAD_UNIT) call abort
34
35       end