1 ! { dg-additional-sources my-usleep.c }
2 ! { dg-prune-output "command-line option '-fintrinsic-modules-path=.*' is valid for Fortran but not for C" }
8 subroutine usleep(t
) bind(C
, name
="my_usleep")
10 integer(c_int
), value
:: t
15 subroutine test (ifval
)
16 logical, value
:: ifval
17 integer :: a(0:7), b(0:7), i
27 !$omp task shared(a) depend(in: a(0))
32 !$omp task shared(a) depend(out: a(1))
37 !$omp task shared(a) depend(inout: a(2))
42 !$omp task shared(a) depend(mutexinoutset: a(3))
52 !$omp task shared(b) depend(in: b(0))
57 !$omp task shared(b) depend(in: b(4))
62 !$omp task shared(b) depend(inoutset: b(5))
68 ! None of the above tasks depend on each other.
69 ! The following task depends on all but the a(4) = 46; one.
70 !$omp task shared(a, b) depend(out: omp_all_memory) private(i) if(ifval)
72 if (a(0) /= 42 .or
. a(1) /= 43 .or
. a(2) /= 44 .or
. a(3) /= 45 &
73 .or
. a(5) /= 5 .or
. a(6) /= 6 .or
. a(7) /= 7 &
74 .or
. b(0) /= 47 .or
. b(1) /= 2 .or
. b(2) /= 4 .or
. b(3) /= 6 &
75 .or
. b(4) /= 48 .or
. b(5) /= 49 .or
. b(6) /= 12 .or
. b(7) /= 14) &
85 ! The following task depends on both b(0) = 47; and
86 ! above omp_all_memory tasks, but as the latter depends on
87 ! the former, effectively it is dependent just on the omp_all_memory
89 !$omp task shared(b) depend(inout: b(0))
94 ! The following task depends on all the above except a(4) = 46; one,
95 ! but it can be reduced to dependency on the above omp_all_memory
96 ! one and b(0) = 49; one.
97 !$omp task shared(a, b) depend(inout: b(7), omp_all_memory, b(6)) &
98 !$omp& private(i) if(ifval)
102 if (a(i
) /= 3 * i
+ 7) &
111 if (b(i
) /= 4 * i
- 7) &
119 end block
! end single
120 end block
! end parallel