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

Subversion Repositories openrisc

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

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

! { dg-do compile }
!
! PR fortran/48810
!
! Contributed by Andrew Baldwin
!
      module qtest
      type foobar
        integer :: x
        contains
        private
        procedure :: gimmex
        generic, public :: getx => gimmex
      end type foobar
      contains
        function gimmex(foo)
          class (foobar) :: foo
          integer :: gimmex
          gimmex = foo%x
        end function gimmex
      end module qtest

      module qtestPriv
      type foobarPriv
        integer :: x
        contains
        private
        procedure :: gimmexPriv
        generic, private :: getxPriv => gimmexPriv
      end type foobarPriv
      contains
        function gimmexPriv(foo)
          class (foobarPriv) :: foo
          integer :: gimmex
          gimmex = foo%x
        end function gimmexPriv
      end module qtestPriv

      program quicktest
      use qtest
      use qtestPriv
      type (foobar) :: foo
      type (foobarPriv) :: fooPriv
      integer :: bar
      bar = foo%getx()  ! OK
      bar = fooPriv%getxPriv() ! { dg-error " is PRIVATE " }
      end program quicktest

! { dg-final { cleanup-modules "qtest qtestpriv" } }

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.