Retro68/gcc/gcc/testsuite/gfortran.dg/allocate_alloc_opt_13.f90
2015-08-28 17:33:40 +02:00

29 lines
443 B
Fortran

! { dg-do compile }
!
! PR fortran/51953
!
!
type t
end type t
class(t), allocatable :: a, c(:), e(:)
class(t), pointer :: b, d(:)
allocate (a, b, source=c(1))
allocate (c(4), d(6), source=e)
allocate (a, b, mold=f())
allocate (c(1), d(6), mold=g())
allocate (a, b, source=f())
allocate (c(1), d(6), source=g())
contains
function f()
class(t), allocatable :: f
end function
function g()
class(t), allocatable :: g(:)
end function
end