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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [typebound_call_5.f03] - Rev 720

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.