hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_comp_5.f90
blob7c97ddcd53b0bdedb5b7da02ff35cae26202661a
1 ! { dg-do run }
3 ! PR39630: Fortran 2003: Procedure pointer components.
5 ! Nested types / double component references.
7 ! Contributed by Janus Weil <janus@gcc.gnu.org>
9 abstract interface
10 subroutine as
11 end subroutine
12 integer function af()
13 end function
14 end interface
16 type :: t1
17 procedure(as), pointer, nopass :: s
18 procedure(af), pointer, nopass :: f
19 end type
21 type :: t2
22 type(t1) :: c
23 end type
25 type(t2) :: x
26 integer :: j = 0
28 x%c%s => is
29 call x%c%s
30 if (j/=5) STOP 1
32 x%c%f => if
33 j=x%c%f()
34 if (j/=42) STOP 2
36 contains
38 subroutine is
39 j = 5
40 end subroutine
42 integer function if()
43 if = 42
44 end function
46 end