2 ! Tests the fix for PR35959, in which the structure subpattern was declared static
3 ! so that this test faied on the second recursive call.
5 ! Contributed by Michaƫl Baudin <michael.baudin@gmail.com>
9 integer, dimension(:), allocatable
:: chars
11 integer, save :: callnb
= 0
13 allocate ( this
% chars ( 4))
14 if (.not
.recursivefunc (this
) .or
. (callnb
.ne
. 10)) call abort ()
16 recursive function recursivefunc ( this
) result ( match
)
17 type(t_type
), intent(in
) :: this
18 type(t_type
) :: subpattern
21 match
= (callnb
== 10)
22 if ((.NOT
. allocated (this
% chars
)) .OR
. match
) return
23 allocate ( subpattern
% chars ( 4 ) )
24 match
= recursivefunc ( subpattern
)
25 end function recursivefunc