[Transforms] Silence a warning in SROA.cpp (NFC)
[llvm-project.git] / openmp / runtime / test / tasking / issue-50602.c
blobb691204c480e38032dcedfd9653e6c858bfa95ae
1 // RUN: %libomp-compile-and-run
2 // RUN: env OMP_NUM_THREADS=1 %libomp-run
3 // RUN: %libomp-compile -DUSE_HIDDEN_HELPERS=1
4 // RUN: %libomp-run
5 // RUN: env OMP_NUM_THREADS=1 %libomp-run
6 #include <omp.h>
8 int main(int argc, char *argv[]) {
9 int i;
11 omp_set_max_active_levels(1);
12 omp_set_dynamic(0);
14 for (i = 0; i < 10; ++i) {
15 #pragma omp parallel
17 #ifndef USE_HIDDEN_HELPERS
18 omp_event_handle_t event;
19 #endif
20 int a = 0;
22 #ifdef USE_HIDDEN_HELPERS
23 #pragma omp target map(tofrom : a) nowait
24 #else
25 #pragma omp task shared(a) detach(event)
26 #endif
27 { a = 1; }
29 #pragma omp parallel
30 { a = 2; }
32 #ifndef USE_HIDDEN_HELPERS
33 omp_fulfill_event(event);
34 #endif
36 #pragma omp taskwait
39 return 0;