llvm-project/flang/test/Semantics/OpenMP/do-concurrent-collapse.f90
Jan Leyonberg d452e67ee7
[flang][OpenMP] Enable tiling (#143715)
This patch enables tiling in flang. In MLIR tiling is handled by
changing the the omp.loop_nest op to be able to represent both collapse
and tiling, so the flang front-end will combine the nested constructs into
a single MLIR op. The MLIR->LLVM-IR lowering of the LoopNestOp is
enhanced to first do the tiling if present, then collapse.
2025-09-10 09:25:40 -04:00

41 lines
873 B
Fortran

!RUN: %python %S/../test_errors.py %s %flang -fopenmp
integer :: i, j
! ERROR: DO CONCURRENT loops cannot be used with the COLLAPSE clause.
!$omp parallel do collapse(2)
do i = 1, 1
! ERROR: DO CONCURRENT loops cannot form part of a loop nest.
do concurrent (j = 1:2)
print *, j
end do
end do
!$omp parallel do
do i = 1, 1
! This should not lead to an error because it is not part of a loop nest:
do concurrent (j = 1:2)
print *, j
end do
end do
!$omp parallel do
! ERROR: DO CONCURRENT loops cannot form part of a loop nest.
do concurrent (j = 1:2)
print *, j
end do
!$omp loop
! Do concurrent is explicitly allowed inside of omp loop
do concurrent (j = 1:2)
print *, j
end do
! ERROR: DO CONCURRENT loops cannot be used with the COLLAPSE clause.
!$omp loop collapse(2)
do i = 1, 1
do concurrent (j = 1:2)
print *, j
end do
end do
end