2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / negative_unit_int8.f
blobd4c35579f044c8bb6fe87fb3b2857cc9d8585370
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
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>
11 ! Bugs submitted by Walt Brainerd
12 integer i
13 integer, parameter ::ERROR_BAD_UNIT = 5005
14 logical l
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
21 i = -11
22 open (unit=i, file="xxx", iostat=i)
23 if (i <= 0) call abort
25 i = -42
26 inquire (unit=i, exist=l)
27 if (l) call abort
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
35 end