libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / extends_14.f03
blob15e38ff90811a324faf8ac1c2fb6932f02a2f02c
1 ! { dg-do compile }
2 ! { dg-options "-fdump-tree-original" }
4 ! PR 49466: [4.6/4.7 Regression] Memory leak with assignment of extended derived types
6 ! Contributed by Rich Townsend <townsend@astro.wisc.edu>
8 program evolve_aflow
10   implicit none
12   type :: state_t
13      real, allocatable :: U(:)
14   end type
16   type, extends(state_t) :: astate_t
17   end type
19  block ! New scoping unit as "a"/"b" are otherwise implicitly SAVEd
20   type(astate_t) :: a,b
22   allocate(a%U(1000))
24   a = b
25  end block
26 end program 
28 ! { dg-final { scan-tree-dump-times "__builtin_free" 3 "original" } }
29 ! { dg-final { cleanup-tree-dump "original" } }