aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_alloc_opt_13.f90
blob: f9e199c43662e24f1d3aac520625089876f8e325 (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
26
27
28
! { 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