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

Subversion Repositories openrisc

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

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

! { dg-do compile }

! Type-bound procedures
! Test for name collision between type-bound procedures and components.

MODULE testmod
  IMPLICIT NONE

  TYPE t
    REAL :: comp
  CONTAINS
    PROCEDURE, NOPASS :: comp => proc ! { dg-error "same name as a component" }
  END TYPE t

  TYPE supert
    INTEGER :: comp1
  CONTAINS
    PROCEDURE, NOPASS :: comp2 => proc
  END TYPE supert

  TYPE, EXTENDS(supert) :: subt1
    INTEGER :: comp2 ! { dg-error "same name" }
  END TYPE subt1

  TYPE, EXTENDS(supert) :: subt2
  CONTAINS
    PROCEDURE, NOPASS :: comp1 => proc ! { dg-error "same name as an inherited component" }
  END TYPE subt2

CONTAINS

  SUBROUTINE proc ()
  END SUBROUTINE proc

END MODULE testmod

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

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.