2 ! PR 27980 - We used to allocate negative amounts of memory
3 ! for functions returning arrays if lbound > ubound-1.
4 ! Based on a test case by beliavsky@aol.com posted to
8 integer, parameter :: n=3,ii(n)=(/2,0,-1/)
10 character(len=80) :: line
12 write (line,'(10I5)') int_func(ii(i))
15 function int_func(n) result(ivec)
16 integer, intent(in) :: n
20 forall (i=1:n) ivec(i) = i