| 1 |
! This test case is expected to fail due to errors. |
| 2 |
|
| 3 |
subroutine f1 (depth, iter) |
| 4 |
integer :: depth, iter |
| 5 |
end subroutine |
| 6 |
|
| 7 |
subroutine f2 (depth, iter) |
| 8 |
integer :: depth, iter |
| 9 |
end subroutine |
| 10 |
|
| 11 |
subroutine s1 (a1, a2, a3) |
| 12 |
integer :: a1, a2, a3 |
| 13 |
integer :: i, j, k |
| 14 |
|
| 15 |
! This loop without intervening code ought to be OK. |
| 16 |
!$omp do ordered(3) |
| 17 |
do i = 1, a1 |
| 18 |
do j = 1, a2 |
| 19 |
do k = 1, a3 |
| 20 |
call f1 (3, k) |
| 21 |
call f2 (3, k) |
| 22 |
!$omp ordered doacross(source:omp_cur_iteration) |
| 23 |
!$omp ordered doacross(sink: i - 2, j + 2, k - 1) |
| 24 |
end do |
| 25 |
end do |
| 26 |
end do |
| 27 |
|
| 28 |
! Adding intervening code should make it error. |
| 29 |
!$omp do ordered(3) ! { dg-error "inner loops must be perfectly nested" } |
| 30 |
do i = 1, a1 |
| 31 |
call f1 (1, i) |
| 32 |
do j = 1, a2 |
| 33 |
call f1 (2, j) |
| 34 |
do k = 1, a3 |
| 35 |
call f1 (3, k) |
| 36 |
call f2 (3, k) |
| 37 |
!$omp ordered doacross(source:omp_cur_iteration) |
| 38 |
!$omp ordered doacross(sink: i - 2, j + 2, k - 1) |
| 39 |
end do |
| 40 |
call f2 (2, j) |
| 41 |
end do |
| 42 |
call f2 (1, i) |
| 43 |
end do |
| 44 |
|
| 45 |
end subroutine |