2 ! Tests the fix for PR25072, in which non-PURE functions could
3 ! be referenced inside a FORALL mask.
5 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
8 integer, parameter :: n
= 4
10 logical function foot (i
)
11 integer, intent(in
) :: i
12 foot
= (i
== 2) .or
. (i
== 3)
21 forall (i
=1:n
, foot (i
)) a(i
) = i
! { dg-error "non-PURE" }
22 if (any (a
.ne
. (/0,2,3,0/))) call abort ()
24 forall (i
=1:n
, s (i
) .or
. t(i
)) a(i
) = i
! { dg-error "non-PURE|LOGICAL" }
25 if (any (a
.ne
. (/0,3,2,1/))) call abort ()
28 forall (i
=1:n
, mod (i
, 2) == 0) a(i
) = w (i
) ! { dg-error "non-PURE" }
29 if (any (a
.ne
. (/0,2,0,4/))) call abort ()
33 integer, intent(in
) :: i
37 integer, intent(in
) :: i
41 ! { dg-final { cleanup-modules "foo" } }