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

Subversion Repositories openrisc

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

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

! { dg-do compile }

! Type-bound procedures
! Test for resolution errors with DEFERRED, namely checks about invalid
! overriding and taking into account inherited DEFERRED bindings.
! Also check that DEFERRED attribute is saved to module correctly.

MODULE m1
  IMPLICIT NONE

  ABSTRACT INTERFACE
    SUBROUTINE intf ()
    END SUBROUTINE intf
  END INTERFACE

  TYPE, ABSTRACT :: abstract_type
  CONTAINS
    PROCEDURE(intf), DEFERRED, NOPASS :: def
    PROCEDURE, NOPASS :: nodef => realproc
  END TYPE abstract_type

CONTAINS

  SUBROUTINE realproc ()
  END SUBROUTINE realproc

END MODULE m1

MODULE m2
  USE m1
  IMPLICIT NONE

  TYPE, ABSTRACT, EXTENDS(abstract_type) :: sub_type1
  CONTAINS
    PROCEDURE(intf), DEFERRED, NOPASS :: nodef ! { dg-error "must not be DEFERRED" }
  END TYPE sub_type1

  TYPE, EXTENDS(abstract_type) :: sub_type2 ! { dg-error "must be ABSTRACT" }
  END TYPE sub_type2

END MODULE m2

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

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.