RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / forall_10.f90
blob7820ed17d60dd24208171a968c66f9a6ce6f72f6
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) STOP 1
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) STOP 2
25 end