Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gfortran.fortran-torture / execute / forall_5.f90
blob0595adf0c89efdc21d52611de3191c9b5e112c76
1 ! Program to test FORALL with pointer assignment inside it.
2 program forall_5
3 type element
4 integer, pointer, dimension(:)::p
5 end type
7 type (element) q(5)
8 integer, target, dimension(25)::t
10 n = 5
11 do i = 1,5
12 q(i)%p => t((i-1)*n + 1:i*n)
13 enddo
15 forall (i = 2:5)
16 q(i)%p => q(i-1)%p
17 end forall
19 do i = 1, 25
20 t(i) = i
21 enddo
23 if (any(q(1)%p .ne. (/1,2,3,4,5/))) call abort
24 if (any(q(2)%p .ne. (/1,2,3,4,5/))) call abort
25 if (any(q(3)%p .ne. (/6,7,8,9,10/))) call abort
26 if (any(q(4)%p .ne. (/11,12,13,14,15/))) call abort
27 if (any(q(5)%p .ne. (/16,17,18,19,20/))) call abort
28 end