summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/typebound_call_14.f03
blob: e8cbf846e5d64a4f0c92dfc7c3310bd3f9c6b5e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
! { dg-do compile }
!
! PR 44211: [OOP] ICE with TBP of pointer component of derived type array
!
! Original test case by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>
! Modified by Janus Weil <janus@gcc.gnu.org>

module ice_module
  type::ice_type
     class(ice_type),pointer::next
   contains
     procedure::ice_sub
     procedure::ice_fun
  end type ice_type
contains
  subroutine ice_sub(this)
    class(ice_type)::this
  end subroutine
  integer function ice_fun(this)
    class(ice_type)::this
  end function
  subroutine ice()
    type(ice_type),dimension(2)::ice_array
    call ice_array(1)%next%ice_sub()
    print *,ice_array(2)%next%ice_fun()
  end subroutine
end module ice_module

! { dg-final { cleanup-modules "ice_module" } }