OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [typebound_call_5.f03] - Rev 437

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

! { dg-do compile }

! Type-bound procedures
! Check for correct access-checking on type-bound procedures.

MODULE m
  IMPLICIT NONE

  TYPE t
  CONTAINS
    PROCEDURE, NOPASS, PRIVATE :: priv => proc
    PROCEDURE, NOPASS, PUBLIC :: publ => proc
  END TYPE t

CONTAINS

  SUBROUTINE proc ()
  END SUBROUTINE proc

  ! This is inside the module.
  SUBROUTINE test1 ()
    IMPLICIT NONE
    TYPE(t) :: obj

    CALL obj%priv () ! { dg-bogus "PRIVATE" }
    CALL obj%publ ()
  END SUBROUTINE test1

END MODULE m

! This is outside the module.
SUBROUTINE test2 ()
  USE m
  IMPLICIT NONE
  TYPE(t) :: obj

  CALL obj%priv () ! { dg-error "PRIVATE" }
  CALL obj%publ ()
END SUBROUTINE test2

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

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.