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