PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_zerosize_1.f90
blob158624e86ee948eac5e006ad319868c1f02e8241
1 ! { dg-do run }
2 program main
3 implicit none
4 real, allocatable :: a(:), b(:,:)
5 integer :: n,m
6 character (len=2) :: one, two
8 one = ' 1'
9 two = ' 2'
11 allocate (a(1:-1))
12 if (size(a) /= 0) STOP 1
13 deallocate (a)
15 allocate (b(1:-1,0:10))
16 if (size(b) /= 0) STOP 2
17 deallocate (b)
19 ! Use variables for array bounds. The internal reads
20 ! are there to hide fact that these are actually constant.
22 read (unit=one, fmt='(I2)') n
23 allocate (a(n:-1))
24 if (size(a) /= 0) STOP 3
25 deallocate (a)
27 read (unit=two, fmt='(I2)') m
28 allocate (b(1:3, m:0))
29 if (size(b) /= 0) STOP 4
30 deallocate (b)
31 end program main