1 // RUN: %libomptarget-compilexx-run-and-check-generic
5 void sum(int *input
, int size
, int *output
) {
6 #pragma omp target teams distribute parallel for reduction(+ : output[0]) \
7 map(to : input[0 : size])
8 for (int i
= 0; i
< size
; i
++)
13 int *array
= new int[size
];
15 for (int i
= 0; i
< size
; i
++)
17 sum(array
, size
, &result
);
19 printf("Result=%d\n", result
);