1 /* Test of gang-private variables declared on loop directive. */
3 /* { dg-additional-options "--param=openacc-kernels=decompose" } */
5 /* { dg-additional-options "-fopt-info-omp-all" }
6 { dg-additional-options "-foffload=-fopt-info-omp-all" } */
8 /* { dg-additional-options "--param=openacc-privatization=noisy" }
9 { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
10 Prune a few: uninteresting:
11 { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } */
13 /* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
14 passed to 'incr' may be unset, and in that case, it will be set to [...]",
15 so to maintain compatibility with earlier Tcl releases, we manually
16 initialize counter variables:
17 { dg-line l_dummy[variable c_compute 0 c_loop_i 0 c_loop_j 0 c_loop_k 0] }
18 { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
19 "WARNING: dg-line var l_dummy defined, but not used". */
24 main (int argc
, char* argv
[])
26 int x
= 5, i
, arr
[32];
28 for (i
= 0; i
< 32; i
++)
31 #pragma acc kernels copy(arr)
33 /* { dg-note {forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis} {} { target *-*-* } .+1 } */
34 #pragma acc loop gang(num:32) private(x) /* { dg-line l_loop_i[incr c_loop_i] } */
35 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
36 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
37 for (i
= 0; i
< 32; i
++)
42 /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */
45 for (i
= 0; i
< 32; i
++)
46 assert (arr
[i
] == i
* 3);