gcc/testsuite/gfortran.dg/pr114535iv.f90
raw| 1 | ! Compiled with pr114535d.f90 |
| 2 | ! Contributed by Andrew Benson <[email protected]> |
| 3 | ! |
| 4 | module iv |
| 5 | type, public :: vs |
| 6 | integer :: i |
| 7 | contains |
| 8 | final :: destructor |
| 9 | end type vs |
| 10 | integer :: ctr = 0 |
| 11 | contains |
| 12 | impure elemental subroutine destructor(s) |
| 13 | type(vs), intent(inout) :: s |
| 14 | s%i = 0 |
| 15 | ctr = ctr + 1 |
| 16 | end subroutine destructor |
| 17 | end module iv |
| 18 |