1! { dg-do run }
2! { dg-options "-frecursive" }
3program recursive_stack
4  call foo (.true.)
5end program recursive_stack
6
7subroutine foo (recurse)
8  logical recurse
9  integer iarray(100,100)
10  if (recurse) then
11     iarray(49,49) = 17
12     call bar
13     if (iarray(49,49) .ne. 17) call abort
14  else
15     iarray(49,49) = 21
16  end if
17end subroutine foo
18
19subroutine bar
20  call foo (.false.)
21end subroutine bar
22