coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / recursive_check_9.f90
blob50af06787fc94366eff81d220be81b5f0a62e237
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 ! Invalid - recursion
10 program test
11 call f(.false.)
12 call f(.true.)
13 contains
14 subroutine f(rec)
15 logical :: rec
16 if(rec) then
17 call g()
18 end if
19 return
20 end subroutine f
21 subroutine g()
22 call f(.false.)
23 return
24 end subroutine g
25 end program test