Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / forall_10.f90
blob1b16840e6432dfcc825142a16709a27407e53898
1 ! { dg-do run }
2 ! { dg-options "-O" }
3 ! Tests the fix for PR30400, in which the use of ANY in the
4 ! FORALL mask was rejected.
6 ! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr>
8 program pr30400_1
9 real, dimension (5, 5, 5, 5) :: a
11 a (:, :, :, :) = 4
12 a (:, 2, :, 4) = 10
13 a (:, 2, :, 1) = 0
15 forall (i = 1:5, j = 1:5, k = 1:5, any (a (i, j, k, :) .gt. 6))
16 forall (l = 1:5, any (a (:, :, :, l) .lt. 2))
17 a (i, j, k, l) = i - j + k - l
18 end forall
19 end forall
20 if (sum (a) .ne. 2625.0) call abort ()
22 ! Check that the fix has not broken the treatment of the '=='
23 forall (i = 1:5, i == 3) a(i, i, i, i) = -5
24 if (sum (a) .ne. 2616.0) call abort ()
25 end