1 // RUN: %clang %openmp_flags %flags-use-compiler-omp-h %s -o %t && %libomp-run
2 // UNSUPPORTED: gcc-5, gcc-6, gcc-7, gcc-8
3 // UNSUPPORTED: clang-5, clang-6, clang-7, clang-8, clang-9, clang-10
9 #include "omp_my_sleep.h"
13 void mutexinoutset_task() {
15 fprintf(stderr
, "mutexinoutset_task: b != 0 at start of task\n");
20 fprintf(stderr
, "mutexinoutset_task: b != 1\n");
26 fprintf(stderr
, "mutexinoutset_task: b != 0 at end of task\n");
31 int main(int argc
, char** argv
) {
32 omp_depend_t dep_a_in
;
33 omp_depend_t dep_a_out
;
34 omp_depend_t dep_a_inout
;
35 omp_depend_t dep_a_mutexinoutset
;
40 #pragma omp depobj(dep_a_in) depend(in: a)
41 #pragma omp depobj(dep_a_out) depend(out: a)
42 #pragma omp depobj(dep_a_inout) depend(inout: a)
43 #pragma omp depobj(dep_a_mutexinoutset) depend(mutexinoutset: a)
50 #pragma omp task depend(depobj: dep_a_out)
56 #pragma omp task depend(depobj: dep_a_inout)
62 #pragma omp task depend(depobj: dep_a_mutexinoutset)
64 #pragma omp task depend(depobj: dep_a_mutexinoutset)
66 #pragma omp task depend(depobj: dep_a_mutexinoutset)
68 #pragma omp task depend(depobj: dep_a_mutexinoutset)
70 #pragma omp task depend(depobj: dep_a_mutexinoutset)
73 #pragma omp task depend(depobj: dep_a_in)
79 fprintf(stderr
, "a (%d) != 21\n", a
);
83 #pragma omp depobj(dep_a_in) destroy
84 #pragma omp depobj(dep_a_out) destroy
85 #pragma omp depobj(dep_a_inout) destroy
86 #pragma omp depobj(dep_a_mutexinoutset) destroy