[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / openmp / libomptarget / deviceRTLs / nvptx / test / parallel / tripcount.c
blobb3f876856408005227775592838dccb8d4cd1312
1 // RUN: %compile-run-and-check
3 #include <omp.h>
4 #include <stdio.h>
6 int main() {
7 int res = 0;
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++)
14 ++res;
16 // The first thread makes 2 iterations, the second - 1. Expected result of the
17 // reduction res is 3.
19 // CHECK: res = 3.
20 printf("res = %d.\n", res);
21 return 0;