libgomp/testsuite/libgomp.oacc-c-c++-common/combined-reduction.c
raw| 1 | /* Test a combined acc parallel loop reduction. */ |
| 2 | |
| 3 | /* { dg-do run } */ |
| 4 | |
| 5 | #include <assert.h> |
| 6 | |
| 7 | int |
| 8 | main () |
| 9 | { |
| 10 | int i, v1 = 0, v2 = 0, n = 100; |
| 11 | |
| 12 | #pragma acc parallel loop reduction(+:v1, v2) |
| 13 | for (i = 0; i < n; i++) |
| 14 | { |
| 15 | v1++; |
| 16 | v2++; |
| 17 | } |
| 18 | |
| 19 | assert (v1 == n); |
| 20 | assert (v2 == n); |
| 21 | |
| 22 | return 0; |
| 23 | } |