RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / data_vector_section.f90
blob3e099de99d034a3d41b61f2989fffc41b29cc117
1 ! { dg-do run }
2 ! PR fortran/49588 - vector sections in data statements
4 block data
5 implicit none
6 integer :: a(8), b(3,2), i
7 data a(::2) /4*1/
8 data a([2,6]) /2*2/
9 data a([4]) /3/
10 data a([(6+2*i,i=1,1)]) /1*5/
11 data b( 1 ,[1,2]) /11,12/
12 data b([2,3],[2,1]) /22,32,21,31/
13 common /com/ a, b
14 end block data
16 program test
17 implicit none
18 integer :: a(8), b(3,2), i, j
19 common /com/ a, b
20 print *, a
21 print *, b
22 ! print *, a - [1,2,1,3,1,2,1,5]
23 ! print *, ((b(i,j)-(10*i+j),i=1,3),j=1,2)
24 if (.not. all (a == [1,2,1,3,1,2,1,5])) stop 1
25 if (.not. all (b == reshape ([((10*i+j,i=1,3),j=1,2)], shape (b)))) stop 2
26 end program test