2 ! Tests fix for PR60717 in which offsets in recursive calls below
3 ! were not being set correctly.
5 ! Reported on comp.lang.fortran by Thomas Schnurrenberger
9 real :: chksum0
= 0, chksum1
= 0, chksum2
= 0
11 recursive subroutine show_real(a
)
12 real, intent(in
) :: a(:)
13 if (size (a
) > 0) then
14 chksum0
= a(1) + chksum0
15 call show_real (a(2:))
18 end subroutine show_real
19 recursive subroutine show_generic1(a
)
20 class(*), intent(in
) :: a(:)
21 if (size (a
) > 0) then
24 chksum1
= a(1) + chksum1
26 call show_generic1 (a(2:)) ! recursive call outside SELECT TYPE
29 end subroutine show_generic1
30 recursive subroutine show_generic2(a
)
31 class(*), intent(in
) :: a(:)
32 if (size (a
) > 0) then
35 chksum2
= a(1) + chksum2
36 call show_generic2 (a(2:)) ! recursive call inside SELECT TYPE
40 end subroutine show_generic2
45 real :: array(1:6) = (/ 0, 1, 2, 3, 4, 5 /)
46 call show_real (array
)
47 call show_generic1 (array
)
48 call show_generic2 (array
)
49 if (chksum0
.ne
. chksum1
) STOP 1
50 if (chksum0
.ne
. chksum2
) STOP 2