Improve atomic store implementation on hppa-linux.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-private-vars-loop-gang-5.c
blobf570c222940e0de94bfab22ce9e43d702c9f5a0d
1 /* { dg-additional-options "-fopt-info-note-omp" }
2 { dg-additional-options "--param=openacc-privatization=noisy" }
3 { dg-additional-options "-foffload=-fopt-info-note-omp" }
4 { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
5 for testing/documenting aspects of that functionality. */
7 #include <assert.h>
9 /* Test of gang-private array variable declared on loop directive, with
10 broadcasting to partitioned workers. */
12 int
13 main (int argc, char* argv[])
15 int x[8], i, arr[32 * 32];
17 for (i = 0; i < 32 * 32; i++)
18 arr[i] = i;
20 #pragma acc kernels copy(arr)
22 #pragma acc loop gang(num:32) private(x)
23 /* { dg-note {variable 'x' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } .-1 } */
24 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 } */
25 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-3 } */
26 for (i = 0; i < 32; i++)
28 for (int j = 0; j < 8; j++)
29 x[j] = j * 2;
31 #pragma acc loop worker(num:32)
32 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
33 for (int j = 0; j < 32; j++)
34 arr[i * 32 + j] += x[j % 8];
38 for (i = 0; i < 32 * 32; i++)
39 assert (arr[i] == i + (i % 8) * 2);
41 return 0;