74 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2! Check for existence of loop following a DO directive3 4subroutine do_imperfectly_nested_before5 integer i, j6 7 !ERROR: The value of the parameter in the COLLAPSE or ORDERED clause must not be larger than the number of nested loops following the construct.8 !$omp do collapse(2)9 do i = 1, 1010 print *, i11 do j = 1, 1012 print *, i, j13 end do14 end do15 !$omp end do16end subroutine17 18 19subroutine do_imperfectly_nested_behind20 integer i, j21 22 !ERROR: Canonical loop nest must be perfectly nested.23 !$omp do collapse(2)24 do i = 1, 1025 do j = 1, 1026 print *, i, j27 end do28 print *, i29 end do30 !$omp end do31end subroutine32 33 34subroutine do_nonrectangular_lb35 integer i, j36 37 !ERROR: Trip count must be computable and invariant38 !$omp do collapse(2)39 do i = 1, 1040 do j = i, 1041 print *, i, j42 end do43 end do44 !$omp end do45end subroutine46 47 48subroutine do_nonrectangular_ub49 integer i, j50 51 !ERROR: Trip count must be computable and invariant52 !$omp do collapse(2)53 do i = 1, 1054 do j = 0, i55 print *, i, j56 end do57 end do58 !$omp end do59end subroutine60 61 62subroutine do_nonrectangular_step63 integer i, j64 65 !ERROR: Trip count must be computable and invariant66 !$omp do collapse(2)67 do i = 1, 1068 do j = 1, 10, i69 print *, i, j70 end do71 end do72 !$omp end do73end subroutine74