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/] [extends_6.f03] - Diff between revs 302 and 384

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do compile }
! { dg-do compile }
! Some errors pointed out in the development of the patch.
! Some errors pointed out in the development of the patch.
!
!
! Contributed by Tobias Burnus  
! Contributed by Tobias Burnus  
!
!
module m
module m
  type :: date
  type :: date
    private
    private
    integer :: yr, mon
    integer :: yr, mon
    integer,public :: day
    integer,public :: day
  end type
  end type
  type :: dt
  type :: dt
    integer :: yr, mon
    integer :: yr, mon
    integer :: day
    integer :: day
  end type
  end type
end module m
end module m
  use m
  use m
  type, extends(date) :: datetime
  type, extends(date) :: datetime
    integer :: hr, min, sec
    integer :: hr, min, sec
  end type
  end type
  type(datetime) :: o_dt
  type(datetime) :: o_dt
  type :: one
  type :: one
    integer :: i
    integer :: i
  end type one
  end type one
  type, extends(one) :: two
  type, extends(one) :: two
    real :: r
    real :: r
  end type two
  end type two
  o_dt%day = 5  ! VALID but failed in first version of EXTENDS patch
  o_dt%day = 5  ! VALID but failed in first version of EXTENDS patch
  o_dt%yr  = 5  ! { dg-error "is a PRIVATE component of" }
  o_dt%yr  = 5  ! { dg-error "is a PRIVATE component of" }
  t = two(one = one(4), i = 5, r=4.4) ! { dg-error "has already been set" }
  t = two(one = one(4), i = 5, r=4.4) ! { dg-error "has already been set" }
  call foo
  call foo
contains
contains
  subroutine foo
  subroutine foo
    use m, date_type => dt
    use m, date_type => dt
    type, extends(date_type) :: dt_type
    type, extends(date_type) :: dt_type
    end type
    end type
    type (dt_type) :: foo_dt
    type (dt_type) :: foo_dt
    foo_dt%date_type%day = 1
    foo_dt%date_type%day = 1
    foo_dt%dt%day = 1 ! { dg-error "not a member" }
    foo_dt%dt%day = 1 ! { dg-error "not a member" }
  end subroutine
  end subroutine
end
end
! { dg-final { cleanup-modules "m" } }
! { dg-final { cleanup-modules "m" } }
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.