Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gfortran.fortran-torture / execute / constructor.f90
blob96cb89d721c7435eff74279394c4bb4c4a356938
1 ! Program to test array constructors
2 program constructors
3 integer, dimension (4) :: a
4 integer, dimension (3, 2) :: b
5 integer i, j, k, l, m, n
7 a = (/1, (i,i=2,4)/)
8 do i = 1, 4
9 if (a(i) .ne. i) call abort
10 end do
12 b = reshape ((/0, 1, 2, 3, 4, 5/), (/3, 2/)) + 1
13 do i=1,3
14 if (b(i, 1) .ne. i) call abort
15 if (b(i, 2) .ne. i + 3) call abort
16 end do
18 k = 1
19 l = 2
20 m = 3
21 n = 4
22 ! The remainder assumes constant constructors work ok.
23 a = (/n, m, l, k/)
24 if (any (a .ne. (/4, 3, 2, 1/))) call abort
25 a = (/((/i+10, 42/), i = k, l)/)
26 if (any (a .ne. (/11, 42, 12, 42/))) call abort
27 a = (/(I, I=k,l) , (J, J=m,n)/)
28 if (any (a .ne. (/1, 2, 3, 4/))) call abort
29 end program