OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [typebound_proc_23.f90] - Rev 715

Go to most recent revision | Compare with Previous | Blame | View Log

! { dg-do run }
!
! PR 49562: [4.6/4.7 Regression] [OOP] assigning value to type-bound function
!
! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>

module ice
  type::ice_type
   contains
     procedure::ice_func
  end type
  integer, target :: it = 0
contains
  function ice_func(this)
    integer, pointer :: ice_func
    class(ice_type)::this
    ice_func => it
  end function ice_func
  subroutine ice_sub(a)
    class(ice_type)::a
    a%ice_func() = 1
  end subroutine ice_sub
end module

use ice
type(ice_type) :: t
if (it/=0) call abort()
call ice_sub(t)
if (it/=1) call abort()
end

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

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.