aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/allocate_alloc_opt_13.f90
blob: 462b12130c5a888a74e9cca21517fea3162386a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! { 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, 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