1 // RUN: %libomp-compile -fopenmp-version=50 && env OMP_NUM_THREADS='3' %libomp-run
2 // RUN: %libomp-compile -fopenmp-version=50 && env OMP_NUM_THREADS='1' %libomp-run
3
4 // Checked gcc 10.1 still does not support detach clause on task construct.
5 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8, gcc-9, gcc-10
6 // clang supports detach clause since version 11.
7 // UNSUPPORTED: clang-10, clang-9, clang-8, clang-7
8 // icc compiler does not support detach clause.
9 // UNSUPPORTED: icc
10
11 #include <omp.h>
12
main()13 int main()
14 {
15 #pragma omp parallel
16 #pragma omp master
17 {
18 omp_event_handle_t event;
19 #pragma omp task detach(event)
20 {
21 omp_fulfill_event(event);
22 }
23 #pragma omp taskwait
24 }
25 return 0;
26 }
27