PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / routine-3.f90
blobe7b9d8ab364f775cbb4e712e2a16338737e4491d
1 ! { dg-do run }
2 ! { dg-options "-fno-inline" }
4 integer, parameter :: n = 10
5 integer :: a(n), i
6 integer, external :: fact
7 !$acc routine (fact)
8 !$acc parallel
9 !$acc loop
10 do i = 1, n
11 a(i) = fact (i)
12 end do
13 !$acc end parallel
14 do i = 1, n
15 if (a(i) .ne. fact(i)) STOP 1
16 end do
17 end
18 recursive function fact (x) result (res)
19 !$acc routine
20 integer, intent(in) :: x
21 integer :: res
22 if (x < 1) then
23 res = 1
24 else
25 res = x * fact (x - 1)
26 end if
27 end function fact