Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / forall_6.f90
blobb277814fb3f338f3476010ae65edbbee1cb8da99
1 ! Program to test FORALL with scalar pointer assignment inside it.
2 program forall_6
3 type element
4 real, pointer :: p
5 end type
7 type (element) q(5)
8 real, target, dimension(5) :: t
9 integer i;
11 t = (/1.0, 2.0, 3.0, 4.0, 5.0/)
13 do i = 1,5
14 q(i)%p => t(i)
15 end do
17 forall (i = 1:5)
18 q(i)%p => q(6 - i)%p
19 end forall
22 do i = 1,5
23 if (q(i)%p .ne. t(6 - i)) call abort
24 end do
25 end