1 // RUN: %compile-run-and-check
9 #pragma omp parallel num_threads(2) reduction(+:res)
11 int tid
= omp_get_thread_num();
12 #pragma omp target teams distribute reduction(+:res)
13 for (int i
= tid
; i
< 2; i
++)
16 // The first thread makes 2 iterations, the second - 1. Expected result of the
17 // reduction res is 3.
20 printf("res = %d.\n", res
);