Debian Codegraph @

gcc/testsuite/gfortran.dg/block_7.f08

raw
1 ! { dg-do run }
2 ! { dg-options "-std=f2008 " }
3
4 ! Check for correct placement (on the stack) of local variables with BLOCK
5 ! and recursive container procedures.
6
7 RECURSIVE SUBROUTINE myproc (i)
8 INTEGER, INTENT(IN) :: i
9 ! Wrap the block up in some other construct so we see this doesn't mess
10 ! things up, either.
11 DO
12 BLOCK
13 INTEGER :: x
14 x = i
15 IF (i > 0) CALL myproc (i - 1)
16 IF (x /= i) STOP 1
17 END BLOCK
18 EXIT
19 END DO
20 END SUBROUTINE myproc
21
22 PROGRAM main
23 CALL myproc (42)
24 END PROGRAM main