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