PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-private-vars-loop-gang-1.c
blob5bc90c2367bcbfe2b62726c7e537782c35461955
1 #include <assert.h>
3 /* Test of gang-private variables declared on loop directive. */
5 int
6 main (int argc, char* argv[])
8 int x = 5, i, arr[32];
10 for (i = 0; i < 32; i++)
11 arr[i] = i;
13 #pragma acc kernels copy(arr)
15 #pragma acc loop gang(num:32) private(x)
16 for (i = 0; i < 32; i++)
18 x = i * 2;
19 arr[i] += x;
23 for (i = 0; i < 32; i++)
24 assert (arr[i] == i * 3);
26 return 0;