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