1! { dg-do run }
2! { dg-options "-fno-inline" }
3
4  module m1
5    contains
6    recursive function fact (x) result (res)
7      !$acc routine
8      integer, intent(in) :: x
9      integer :: res
10      if (x < 1) then
11         res = 1
12      else
13         res = x * fact (x - 1)
14      end if
15    end function fact
16  end module m1
17  use m1
18  integer, parameter :: n = 10
19  integer :: a(n), i
20  !$acc parallel
21  !$acc loop
22  do i = 1, n
23     a(i) = fact (i)
24  end do
25  !$acc end parallel
26  do i = 1, n
27     if (a(i) .ne. fact(i)) STOP 1
28  end do
29end
30