Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.dg / forall_13.f90
blob97f6062bd55a86db93e2d77da04f0980afe1ff00
1 ! { dg-do run }
2 ! Tests the fix for PR33686, in which dependencies were not
3 ! correctly handled for the assignments below.
5 ! Contributed by Dick Hendrickson on comp.lang.fortran,
6 ! " Most elegant syntax for inverting a permutation?" 20071006
8 integer :: p(4) = (/2,4,1,3/)
9 forall (i = 1:4) p(p(i)) = i ! This was the original
10 if (any (p .ne. (/3,1,4,2/))) call abort ()
12 forall (i = 1:4) p(5 - p(i)) = p(5 - i) ! This is a more complicated version
13 if (any (p .ne. (/1,2,3,4/))) call abort ()
14 end