Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / kernels-private-vars-loop-gang-1.f90
blobb4f44d69de15ddcc51af8802ad6b36d9370438e5
1 ! Test of gang-private variables declared on loop directive.
3 ! { dg-do run }
5 ! { dg-additional-options "--param=openacc-kernels=decompose" }
7 ! { dg-additional-options "-fopt-info-omp-all" }
8 ! { dg-additional-options "-foffload=-fopt-info-omp-all" }
10 ! { dg-additional-options "--param=openacc-privatization=noisy" }
11 ! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
12 ! Prune a few: uninteresting:
13 ! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
15 ! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
16 ! passed to 'incr' may be unset, and in that case, it will be set to [...]",
17 ! so to maintain compatibility with earlier Tcl releases, we manually
18 ! initialize counter variables:
19 ! { dg-line l_dummy[variable c_compute 0 c_loop_i 0 c_loop_j 0 c_loop_k 0] }
20 ! { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
21 ! "WARNING: dg-line var l_dummy defined, but not used".
23 program main
24 integer :: x, i, arr(32)
26 do i = 1, 32
27 arr(i) = i
28 end do
30 !$acc kernels copy(arr)
31 ! { dg-note {forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis} {} { target *-*-* } .+1 }
32 !$acc loop gang(num:32) private(x) ! { dg-line l_loop_i[incr c_loop_i] }
33 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i }
34 ! { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i }
35 do i = 1, 32
36 x = i * 2;
37 arr(i) = arr(i) + x;
38 end do
39 ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i }
40 !$acc end kernels
42 do i = 1, 32
43 if (arr(i) .ne. i * 3) stop 1
44 end do
45 end program main