Debian Codegraph @

gcc/testsuite/gfortran.dg/pr97036.f90

raw
1 ! { dg-do compile }
2 ! { dg-options "-std=f2018" }
3 ! PR fortran/97036 - [F2018] Allow ELEMENTAL RECURSIVE procedure prefix
4
5 module m97036
6 implicit none
7 contains
8 impure elemental recursive subroutine foo (n)
9 integer, intent(in) :: n
10 integer :: k(n), f(n), i
11 k = [ (i-1, i=1,n) ]
12 f = fac (k)
13 print *, f
14 end subroutine foo
15 elemental recursive subroutine bla ()
16 end subroutine bla
17 elemental recursive function fac (k) result (f)
18 integer, intent(in) :: k
19 integer :: f
20 f = 1
21 if (k > 1) f = k*fac (k-1)
22 end function fac
23 end module
24 use m97036
25 implicit none
26 call foo ([4,5])
27 end