aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/class_allocate_15.f90
blob: 07c1cb49dbc59518e5c536d918c9d2ca25a8e820 (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 run }
! { dg-options "-fdump-tree-original -fdump-tree-original -fmax-stack-var-size=1" }
!
! PR fortran/56845
!
type t
end type t
type, extends(t) :: t2
end type t2
type(t) :: y
call foo()
call bar()
contains
  subroutine foo()
    class(t), allocatable :: x
    if(allocated(x)) call abort()
    if(.not.same_type_as(x,y)) call abort()
    allocate (t2 :: x)
  end
  subroutine bar()
    class(t), allocatable :: x(:)
    if(allocated(x)) call abort()
    if(.not.same_type_as(x,y)) call abort()
    allocate (t2 :: x(4))
  end
end
! { dg-final { scan-tree-dump-times "__builtin_free" 2 "original" } }
! { dg-final { cleanup-tree-dump "original" } }