2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_init_5.f90
blob1ca773874a275f1ff021f46c081387164edbc633
1 ! { dg-do run }
3 ! PR 45290: [F08] pointer initialization
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 module m
9 implicit none
11 procedure(f1), pointer :: pp => f1
13 type :: t
14 procedure(f2), pointer, nopass :: ppc => f2
15 end type
17 contains
19 integer function f1()
20 f1 = 42
21 end function
23 integer function f2()
24 f2 = 43
25 end function
27 end module
30 program test_ptr_init
32 use m
33 implicit none
35 type (t) :: u
37 if (pp()/=42) call abort()
38 if (u%ppc()/=43) call abort()
40 end