| 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 |
! Unlike the C/C++ front ends, the Fortran front end already has the whole |
| 12 |
! parse tree for the OMP DO construct before doing error checking on it. |
| 13 |
! It gives up immediately if there are not enough nested loops for the |
| 14 |
! specified COLLAPSE depth, without error-checking intervening code. |
| 15 |
|
| 16 |
subroutine s1 (a1, a2, a3) |
| 17 |
integer :: a1, a2, a3 |
| 18 |
integer :: i, j, k |
| 19 |
|
| 20 |
!$omp do collapse(4) ! { dg-error "not enough DO loops" } |
| 21 |
do i = 1, a1 |
| 22 |
call f1 (1, i) |
| 23 |
do j = 1, a2 |
| 24 |
call f1 (2, j) |
| 25 |
do k = 1, a3 |
| 26 |
! This is not valid intervening code, but the above error takes precedence. |
| 27 |
!$omp barrier |
| 28 |
call f1 (3, k) |
| 29 |
call f2 (3, k) |
| 30 |
end do |
| 31 |
call f2 (2, j) |
| 32 |
end do |
| 33 |
call f2 (1, i) |
| 34 |
end do |
| 35 |
|
| 36 |
end subroutine |