2 ! Tests namelist io for an explicit shape array with negative bounds
3 ! provided by Paul Thomas - pault@gcc.gnu.org
6 integer, dimension (-4:-2) :: x
10 open (10, status = "scratch")
11 write (10, '(A)') "&a x(-5)=0 /" !-ve index below lbound
12 write (10, '(A)') "&a x(-1)=0 /" !-ve index above ubound
13 write (10, '(A)') "&a x(1:2)=0 /" !+ve indices
14 write (10, '(A)') "&a x(-4:-2)= -4,-3,-2 /" !correct
19 read(10, a, iostat=ier)
20 if (ier == 0) call abort ()
22 read(10, a, iostat=ier)
23 if (ier == 0) call abort ()
25 read(10, a, iostat=ier)
26 if (ier == 0) call abort ()
29 read(10, a, iostat=ier)
30 if (ier /= 0) call abort ()
32 if (x(i) /= i) call abort ()
35 end program namelist_20