Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / namelist_61.f90
blobc7214dd2bb946fd6136f879979839381400c9da8
1 ! { dg-do run }
3 ! PR fortran/43228
5 integer :: a(3,3)
6 character(len=100) :: str
7 namelist /nml/a
9 a = -1
10 str = '&nml a(1,:) = 1 2 3 /'
11 read(str, nml=nml)
12 if (any (a(1,:) /= [1, 2, 3])) call abort ()
13 if (any (a([2,3],:) /= -1)) call abort ()
15 a = -1
16 str = '&nml a(1,1) = 1 2 3 4 /'
17 read(str, nml=nml)
18 if (any (a(:,1) /= [1, 2, 3])) call abort ()
19 if (any (a(:,2) /= [4, -1, -1])) call abort ()
20 if (any (a(:,3) /= -1)) call abort ()
22 str = '&nml a(1,:) = 1 2 3 , &
23 & a(2,:) = 4,5,6 &
24 & a(3,:) = 7 8 9/'
25 read(str, nml=nml)
26 if (any (a(1,:) /= [1, 2, 3])) call abort ()
27 if (any (a(2,:) /= [4, 5, 6])) call abort ()
28 if (any (a(3,:) /= [7, 8, 9])) call abort ()
30 !print *, a(:,1)
31 !print *, a(:,2)
32 !print *, a(:,3)
33 end