OSDN Git Service

53a7daa8c2587df211368bba2a556458cf3e550c
[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 = 0
17 ! gfortran created a 'fort.-1' file and wrote "Hello" in it
18       write (unit=-1, fmt=*, iostat=i) "Hello"
19       if (i <= 0) call abort
20       
21       i = 0
22       open (unit=-11, file="xxx", iostat=i)
23       if (i <= 0) call abort
24
25       i = 0
26       inquire (unit=-42, exist=l)
27       if (l) call abort
28
29       i = 0 
30 ! This one is nasty
31       inquire (unit=2_8*huge(0_4)+20_8, exist=l, iostat=i)
32       if (l) call abort
33       if (i.ne.ERROR_BAD_UNIT) call abort
34
35       end