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

Subversion Repositories openrisc

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

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

! { dg-do compile }

! Abstract Types.
! Check for module file IO.

MODULE m
  IMPLICIT NONE

  TYPE, ABSTRACT :: abst_t
    INTEGER :: x
  END TYPE abst_t

  TYPE, EXTENDS(abst_t) :: concrete_t
    INTEGER :: y
  END TYPE concrete_t

END MODULE m

PROGRAM main
  USE m
  IMPLICIT NONE

  TYPE(abst_t) :: abst ! { dg-error "is of the ABSTRACT type 'abst_t'" }
  TYPE(concrete_t) :: conc

  ! See if constructing the extending type works.
  conc = concrete_t (1, 2)
END PROGRAM main
! { 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.