aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8.3/gcc/testsuite/gfortran.dg/move_alloc_4.f90
blob: 4dc493f097f13f2df852b415db335670a8f59447 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do run }
! { dg-options "-fdump-tree-original" }
!
! PR 48700: memory leak with MOVE_ALLOC
!
! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>

program testmv3
  type bar
    integer, allocatable  :: ia(:), ja(:)
  end type

  type(bar), allocatable :: sm,sm2

  allocate(sm)
  allocate(sm%ia(10),sm%ja(10))

  call move_alloc(sm2,sm)

end program testmv3 

! { dg-final { scan-tree-dump-times "__builtin_free" 9 "original" } }
! { dg-final { cleanup-tree-dump "original" } }