Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gfortran.dg / proc_ptr_result_7.f90
1 ! { dg-do run }
2 !
3 ! PR 54285: [F03] Calling a PPC with proc-ptr result
4 !
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
6
7 type :: t
8   procedure(a), pointer, nopass :: p
9 end type
10
11 type(t) :: x
12 procedure(iabs), pointer :: pp
13
14 x%p => a
15
16 pp => x%p()
17
18 if (pp(-3) /= 3) call abort
19
20 contains
21
22   function a() result (b)
23     procedure(iabs), pointer :: b
24     b => iabs
25   end function
26
27 end