libgomp/testsuite/libgomp.fortran/examples-4/task_dep-4.f90
raw| 1 | ! { dg-do run } |
| 2 | |
| 3 | program example |
| 4 | integer :: x |
| 5 | x = 1 |
| 6 | !$omp parallel |
| 7 | !$omp single |
| 8 | !$omp task shared(x) depend(out: x) |
| 9 | x = 2 |
| 10 | !$omp end task |
| 11 | !$omp task shared(x) depend(in: x) |
| 12 | if (x .ne. 2) stop 1 |
| 13 | !$omp end task |
| 14 | !$omp task shared(x) depend(in: x) |
| 15 | if (x .ne. 2) stop 2 |
| 16 | !$omp end task |
| 17 | !$omp end single |
| 18 | !$omp end parallel |
| 19 | end program |