modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_result_7.f90
blob5433cdeb560258ef11a1efa8f5771d216e283698
1 ! { dg-do run }
3 ! PR 54285: [F03] Calling a PPC with proc-ptr result
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 type :: t
8 procedure(a), pointer, nopass :: p
9 end type
11 type(t) :: x
13 ! We cannot use "iabs" directly as it is elemental.
14 abstract interface
15 pure integer function interf_iabs(x)
16 integer, intent(in) :: x
17 end function interf_iabs
18 end interface
19 procedure(interf_iabs), pointer :: pp
21 x%p => a
23 pp => x%p()
25 if (pp(-3) /= 3) STOP 1
27 contains
29 function a() result (b)
30 procedure(interf_iabs), pointer :: b
31 b => iabs
32 end function
34 end