URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 302 |
Rev 384 |
! { dg-do run }
|
! { dg-do run }
|
! { dg-options "-fcheck=recursion" }
|
! { dg-options "-fcheck=recursion" }
|
! { dg-shouldfail "Recursion check" }
|
! { dg-shouldfail "Recursion check" }
|
!
|
!
|
! { dg-output "Fortran runtime error: Recursive call to nonrecursive procedure 'f'" }
|
! { dg-output "Fortran runtime error: Recursive call to nonrecursive procedure 'f'" }
|
!
|
!
|
! PR fortran/39577
|
! PR fortran/39577
|
!
|
!
|
! wrong - recursion
|
! wrong - recursion
|
program test
|
program test
|
integer :: i
|
integer :: i
|
i = f(.false.)
|
i = f(.false.)
|
print *,i
|
print *,i
|
i = f(.true.)
|
i = f(.true.)
|
print *,i
|
print *,i
|
contains
|
contains
|
integer function f(rec)
|
integer function f(rec)
|
logical :: rec
|
logical :: rec
|
if(rec) then
|
if(rec) then
|
f = g()
|
f = g()
|
else
|
else
|
f = 42
|
f = 42
|
end if
|
end if
|
end function f
|
end function f
|
integer function g()
|
integer function g()
|
g = f(.false.)
|
g = f(.false.)
|
end function g
|
end function g
|
end program test
|
end program test
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.