nvptx, libgfortran: Switch out of "minimal" mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / recursive_check_11.f90
blob870c1127d012cccc1697ba9b4814383a39e5c1ba
1 ! { dg-do run }
2 ! { dg-options "-fcheck=recursion" }
3 ! { dg-shouldfail "Recursion check" }
5 ! { dg-output "Fortran runtime error: Recursive call to nonrecursive procedure 'f'" }
7 ! PR fortran/39577
9 ! wrong - recursion
10 program test
11 integer :: i
12 i = f(.false.)
13 print *,i
14 i = f(.true.)
15 print *,i
16 contains
17 integer function f(rec)
18 logical :: rec
19 if(rec) then
20 f = g()
21 else
22 f = 42
23 end if
24 end function f
25 integer function g()
26 g = f(.false.)
27 end function g
28 end program test