]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/gfortran.dg/associate_25.f90
Fortran: Fix bugs and missing features in finalization [PR37336]
[gcc.git] / gcc / testsuite / gfortran.dg / associate_25.f90
CommitLineData
62d3c075
PT
1! { dg-do run }
2!
3! Checks the fix for PR60483.
4!
5! Contributed by Anthony Lewis <antony@cosmologist.info>
6!
7module A
8 implicit none
9 Type T
10 integer :: val = 2
11 contains
12 final :: testfree
13 end type
14 integer :: final_flag = 0
15contains
16 subroutine testfree(this)
17 Type(T) this
18 final_flag = this%val + final_flag
19 end subroutine
20 subroutine Testf()
21 associate(X => T()) ! This was failing: Symbol 'x' at (1) has no IMPLICIT type
22 final_flag = X%val
23 end associate
d7caf313 24 if (final_flag .ne. 2) stop 1
62d3c075
PT
25 end subroutine Testf
26end module
27
28 use A
29 call Testf
30end
This page took 4.557715 seconds and 5 git commands to generate.