2 ! Tests the fix for the second bit of PR29389, in which the
3 ! statement function would not be recognised as not PURE
4 ! when it referenced a procedure that is not PURE.
6 ! This is based on stfunc_4.f90 with the statement function made
7 ! impure by a reference to 'v'.
9 ! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
11 INTEGER :: st1
, i
= 99, a(4), q
= 6
13 FORALL(i
=1:4) a(i
) = st1 (i
)
14 FORALL(i
=1:4) a(i
) = u (a(i
)) - a(i
)** 2
15 if (any (a
.ne
. 0)) call abort ()
16 if (i
.ne
. 99) call abort ()
18 pure
integer function u (x
)
19 integer,intent(in
) :: x
20 st2 (i
) = i
* v(i
) ! { dg-error "non-PURE procedure" }
23 integer function v (x
)
24 integer,intent(in
) :: x