| ! { dg-options "-w -fdump-tree-original" } |
| ! Contributed by Sebastian Bardeau <bardeau@iram.fr> |
| integer(kind=4), allocatable :: a(:) |
| subroutine mysubtype_final(sub) |
| type(mysubtype), intent(inout) :: sub |
| print *,'MYSUBTYPE>FINAL' |
| if (allocated(sub%a)) deallocate(sub%a) |
| end subroutine mysubtype_final |
| subroutine mytype_final(typ) |
| type(mytype), intent(inout) :: typ |
| call mysubtype_final(typ%sub) |
| end subroutine mytype_final |
| type(mytype), pointer :: c |
| print *,"Before allocation" |
| print *,"After allocation" |
| ! Final subroutines were called with std=gnu and -w = > 14 "_final"s. |
| ! { dg-final { scan-tree-dump-times "_final" 12 "original" } } |