1 ! { dg-additional-sources my-usleep.c }
2 ! { dg-additional-options -Wno-complain-wrong-lang }
9 subroutine usleep(t
) bind(C
, name
="my_usleep")
11 integer(c_int
), value
:: t
16 subroutine test (ifval
)
17 logical, value
:: ifval
18 integer :: a(0:7), b(0:7), i
19 integer(omp_depend_kind
) d1
, d2
20 !$omp depobj (d1) depend(inout: omp_all_memory)
21 !$omp depobj (d2) depend(out: omp_all_memory)
30 !$omp task shared(a) depend(in: a(0))
35 !$omp task shared(a) depend(out: a(1))
40 !$omp task shared(a) depend(inout: a(2))
45 !$omp task shared(a) depend(mutexinoutset: a(3))
55 !$omp task shared(b) depend(in: b(0))
60 !$omp task shared(b) depend(in: b(4))
65 !$omp task shared(b) depend(inoutset: b(5))
71 ! None of the above tasks depend on each other.
72 ! The following task depends on all but the a(4) = 46; one.
73 !$omp task shared(a, b) depend(depobj: d1) private(i) if(ifval)
75 if (a(0) /= 42 .or
. a(1) /= 43 .or
. a(2) /= 44 .or
. a(3) /= 45 &
76 .or
. a(5) /= 5 .or
. a(6) /= 6 .or
. a(7) /= 7 &
77 .or
. b(0) /= 47 .or
. b(1) /= 2 .or
. b(2) /= 4 .or
. b(3) /= 6 &
78 .or
. b(4) /= 48 .or
. b(5) /= 49 .or
. b(6) /= 12 .or
. b(7) /= 14) &
88 ! The following task depends on both b(0) = 47; and
89 ! above omp_all_memory tasks, but as the latter depends on
90 ! the former, effectively it is dependent just on the omp_all_memory
92 !$omp task shared(b) depend(inout: b(0))
97 ! The following task depends on all the above except a(4) = 46; one,
98 ! but it can be reduced to dependency on the above omp_all_memory
99 ! one and b(0) = 49; one.
100 !$omp task shared(a, b) depend(inout: b(6)) depend(depobj: d2) &
101 !$omp& depend(out: b(7)) private(i) if(ifval)
105 if (a(i
) /= 3 * i
+ 7) &
114 if (b(i
) /= 4 * i
- 7) &
124 !$omp depobj (d2) destroy
125 !$omp depobj (d1) destroy