Files
clang-p2996/flang/test/Semantics/OpenMP/do09.f90
Kiran Chandramohan 977cb5d1cb [Flang][OpenMP] Restrict certain loops not allowed in associated loops (#91818)
Extends the OmpCycleAndExitChecker to check that associated loops of a
loop construct are not DO WHILE or DO without control.

OpenMP 5.0 standard clearly mentions this restriction. Later standards
enforce this through the definition of associated loops and canonical
loop forms.
https://www.openmp.org/spec-html/5.0/openmpsu41.html

Fixes #81949
2024-07-16 11:41:19 +01:00

27 lines
623 B
Fortran

! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! OpenMP Version 4.5
! 2.7.1 Loop Construct
! The do-loop cannot be a DO WHILE or a DO loop without loop control.
program omp_do
integer :: i = 0,k
!$omp do
!ERROR: The associated loop of a loop-associated directive cannot be a DO WHILE.
do while (i <= 10)
print *, "it",i
i = i+1
end do
!$omp end do
!$omp do
!ERROR: The associated loop of a loop-associated directive cannot be a DO WHILE.
do while (i <= 10)
do while (j <= 10)
print *, "it",k
j = j+1
end do
i = i+1
end do
!$omp end do
end program omp_do