Daily bump.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / routine-3.f90
blob38218263851d091a1cb706acc199575c688dbb79
1 ! { dg-do run }
2 ! { dg-options "-fno-inline" }
4 ! { dg-additional-options "-fopt-info-all-omp" }
5 ! { dg-additional-options "-foffload=-fopt-info-all-omp" }
7 ! { dg-additional-options "--param=openacc-privatization=noisy" }
8 ! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
9 ! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
10 ! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
12 integer, parameter :: n = 10
13 integer :: a(n), i
14 integer, external :: fact
15 !$acc routine (fact)
16 !$acc parallel
17 !$acc loop ! { dg-line l_loop1 }
18 ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 }
19 ! { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 }
20 ! { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 }
21 ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 }
22 ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 }
23 do i = 1, n
24 a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
25 end do
26 !$acc end parallel
27 do i = 1, n
28 if (a(i) .ne. fact(i)) STOP 1
29 end do
30 end
31 recursive function fact (x) result (res)
32 !$acc routine
33 integer, intent(in) :: x
34 integer :: res
35 if (x < 1) then
36 res = 1
37 else
38 res = x * fact (x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
39 end if
40 end function fact