sched1: debug/model: dump predecessor list and BB num [NFC]
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / reduction-6.c
blob82a6ade40f9c50f0804af8fc9447616e2b5247c4
1 /* { dg-do run } */
3 /* Test reductions on explicitly private variables. */
5 #include <assert.h>
7 int
8 main ()
10 int i, j, red[10];
11 int v;
13 for (i = 0; i < 10; i++)
14 red[i] = -1;
16 #pragma acc parallel copyout(red)
18 #pragma acc loop gang private(v)
19 for (j = 0; j < 10; j++)
21 v = j;
23 #pragma acc loop vector reduction (+:v)
24 for (i = 0; i < 100; i++)
25 v++;
27 red[j] = v;
31 for (i = 0; i < 10; i++)
32 assert (red[i] == i + 100);
34 return 0;