3 ! PR 36704: Procedure pointer as function result
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
12 procedure(integer),pointer :: j
18 integer,intent(inout
) :: y
30 procedure(integer),pointer :: p
,p2
31 procedure(sub
),pointer :: ps
34 if (p(-1)/=1) call abort()
36 if (p(-2)/=2) call abort()
38 if (p(-3)/=3) call abort()
43 if (x
/=16) call abort()
46 if (p(-4)/=4) call abort()
51 if (x
/=25) call abort()
54 if (p(-5)/=5) call abort()
56 if (p(-6)/=6) call abort()
58 if (p(-7)/=7) call abort()
63 if (x
/=4) call abort()
66 if (p(-8)/=8) call abort()
68 if (p(-9)/=9) call abort()
71 if (p(-10)/=p2(-10)) call abort()
74 if (p(-11)/=11) call abort()
79 procedure(integer),pointer :: a
84 procedure(integer) :: b
91 procedure(integer) :: c
124 integer function f(x
)
125 integer,intent(in
) :: x
133 integer function g(x
)
134 integer,intent(in
) :: x
144 integer,intent(inout
) :: b
150 integer,intent(inout
) :: a
168 procedure(integer),pointer :: k
,arg
174 ! we cannot use iabs directly as it is elemental
176 pure
function interf_iabs(x
)
177 integer, intent(in
) :: x
178 end function interf_iabs
180 procedure(interf_iabs
),pointer :: l
183 if (l(-11)/=11) call abort()