[llvm] Stop including unordered_map (NFC)
[llvm-project.git] / openmp / runtime / test / tasking / omp_taskloop_taskwait.c
blob6cb226461c8ebeff97faf032f90f186560a1a309
1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include <omp.h>
4 int main()
6 enum {ITERS = 500};
7 enum {SIZE = 5};
8 int err = 0;
9 #pragma omp parallel num_threads(2) reduction(+:err)
11 int r = 0;
12 int i;
13 #pragma omp taskloop grainsize(SIZE) shared(r) nogroup
14 for(i=0; i<ITERS; i++) {
15 #pragma omp atomic
16 ++r;
18 #pragma omp taskwait
19 printf("%d\n", r);
20 if (r != ITERS)
21 err++;
22 } // end of parallel
23 if (err != 0) {
24 printf("failed, err = %d\n", err);
25 return 1;
26 } else {
27 printf("passed\n");
28 return 0;