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

Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do compile }
! { dg-do compile }
!
!
! ALLOCATE statements with derived type specification
! ALLOCATE statements with derived type specification
!
!
! Contributed by Janus Weil 
! Contributed by Janus Weil 
 type :: t1
 type :: t1
  integer :: i
  integer :: i
 end type
 end type
 type, extends(t1) :: t2
 type, extends(t1) :: t2
  real :: r
  real :: r
 end type
 end type
 type, extends(t2) :: t3
 type, extends(t2) :: t3
  real :: q
  real :: q
 end type
 end type
 type, abstract :: u0
 type, abstract :: u0
  logical :: nothing
  logical :: nothing
 end type
 end type
 type :: v1
 type :: v1
  real :: r
  real :: r
 end type
 end type
 class(t1),dimension(:),allocatable :: x
 class(t1),dimension(:),allocatable :: x
 type(t2),dimension(:),allocatable :: y
 type(t2),dimension(:),allocatable :: y
 class(t3),dimension(:),allocatable :: z
 class(t3),dimension(:),allocatable :: z
 allocate(      x(1))
 allocate(      x(1))
 allocate(t1 :: x(2))
 allocate(t1 :: x(2))
 allocate(t2 :: x(3))
 allocate(t2 :: x(3))
 allocate(t3 :: x(4))
 allocate(t3 :: x(4))
 allocate(tx :: x(5))  ! { dg-error "is not an accessible derived type" }
 allocate(tx :: x(5))  ! { dg-error "is not an accessible derived type" }
 allocate(u0 :: x(6))  ! { dg-error "may not be ABSTRACT" }
 allocate(u0 :: x(6))  ! { dg-error "may not be ABSTRACT" }
 allocate(v1 :: x(7))  ! { dg-error "is type incompatible with typespec" }
 allocate(v1 :: x(7))  ! { dg-error "is type incompatible with typespec" }
 allocate(      y(1))
 allocate(      y(1))
 allocate(t1 :: y(2))  ! { dg-error "is type incompatible with typespec" }
 allocate(t1 :: y(2))  ! { dg-error "is type incompatible with typespec" }
 allocate(t2 :: y(3))
 allocate(t2 :: y(3))
 allocate(t3 :: y(3))  ! { dg-error "is type incompatible with typespec" }
 allocate(t3 :: y(3))  ! { dg-error "is type incompatible with typespec" }
 allocate(      z(1))
 allocate(      z(1))
 allocate(t1 :: z(2))  ! { dg-error "is type incompatible with typespec" }
 allocate(t1 :: z(2))  ! { dg-error "is type incompatible with typespec" }
 allocate(t2 :: z(3))  ! { dg-error "is type incompatible with typespec" }
 allocate(t2 :: z(3))  ! { dg-error "is type incompatible with typespec" }
 allocate(t3 :: z(4))
 allocate(t3 :: z(4))
end
end
 
 

powered by: WebSVN 2.1.0

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