2 ! Test fix for PR54286.
4 ! Contributed by Janus Weil <janus@gcc.gnu.org>
5 ! Module 'm' added later because original fix missed possibility of
6 ! null interfaces - thanks to Dominique Dhumieres <dominiq@lps.ens.fr>
10 real, pointer :: array(:)
11 procedure (), pointer, nopass
:: f
14 elemental
subroutine fooAssgn (a1
, a2
)
15 type(foobar
), intent(out
) :: a1
16 type(foobar
), intent(in
) :: a2
17 allocate (a1
%array(size(a2
%array
)))
25 procedure(a
), pointer, nopass
:: p
29 ! We cannot use iabs directly as it is elemental
31 integer pure
function interf_iabs(x
)
32 integer, intent(in
) :: x
33 end function interf_iabs
36 procedure(interf_iabs
), pointer :: pp
37 procedure(foo
), pointer :: pp1
40 if (x
%p(0) .ne
. loc(foo
)) STOP 1
41 if (x
%p(1) .ne
. loc(iabs
)) STOP 2
43 x
%p
=> a(1) ! { dg-error "PROCEDURE POINTER mismatch in function result" }
46 if (pp(-99) .ne
. iabs(-99)) STOP 3
49 if (pp1(-99) .ne
. -iabs(-99)) STOP 4
51 pp
=> a
! { dg-error "PROCEDURE POINTER mismatch in function result" }
55 function a (c
) result (b
)
56 integer, intent(in
) :: c
57 procedure(interf_iabs
), pointer :: b
65 pure
integer function foo (arg
)
66 integer, intent (in
) :: arg