2 ! PR 25806: Functions returning pointers to arrays
4 integer, target
:: storage(5)
8 print *, x(3) ! { dg-output " *1 *2 *3" }
10 if (ssum(x(3)) /= 6) STOP 1
14 if (any(s
/= (/1, 2, 3/))) STOP 2
18 function x(n
) result(t
)
19 integer, intent(in
) :: n
20 integer, pointer :: t(:)
24 t
= (/ (i
, i
= 1, n
) /)
29 integer function ssum(a
)
30 integer, intent(in
) :: a(:)