2016-01-15 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / unit_1.f90
blob5233bc870194fb642d3a1816de83f0594f66a773
1 ! { dg-do run }
2 ! PR40638 Run Time Error: Unit number in I/O statement too large
3 program main
4 integer(kind=2) :: lun, anum
5 integer(kind=1) :: looney, bin
6 lun = 12
7 anum = 5
8 looney = 42
9 bin = 23
10 open (lun, status='scratch')
11 write(lun,*) anum
12 anum = 0
13 rewind(lun)
14 read (lun, *) anum
15 if (anum.ne.5) call abort
16 open (looney, status='scratch')
17 write(looney,*)bin
18 bin = 0
19 rewind (looney)
20 read (looney,*)bin
21 if (bin.ne.23) call abort
22 close (lun)
23 close (looney)
24 end