gcc/fortran/
[official-gcc.git] / gcc / testsuite / gfortran.dg / finalize_16.f90
blob89c5cfb8d99f8f6a903726dd7918aca1957ad6e1
1 ! { dg-do compile }
2 ! { dg-options "-fcheck=all" }
4 ! PR fortran/57542
6 ! Contributed by Salvatore Filippone
8 module type_mod
9 type inner
10 end type inner
12 type outer
13 class(inner), allocatable :: item
14 end type outer
16 type container
17 class(outer), allocatable :: item
18 end type container
20 type maintype
21 type(container), allocatable :: v(:)
22 end type maintype
24 end module type_mod
26 subroutine testfinal(var)
27 use type_mod
28 type(maintype), intent(inout) :: var
29 ! A real code would obviously check
30 ! this is really allocated
31 deallocate(var%v(1)%item%item)
32 end subroutine testfinal