Files
clang-p2996/flang/test/Semantics/omp-do-cycle.f90
Michael Kruse 58c3f20bbf [flang][windows] Run regression tests under Windows. NFCI.
Allow the lit test suite to run under Windows. This encompasses the following changes:

 * Define `lit_tools_dir` for flang's test configuration
 * Replace `(<command> || true)` idiom with `not <command>`
 * Add `REQUIRES: shell` on tests that invoke a shell script

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D89368
2021-06-10 05:13:44 -05:00

46 lines
1.1 KiB
Fortran

! RUN: %S/test_errors.sh %s %t %flang -fopenmp
! REQUIRES: shell
! OpenMP Version 4.5
! Check for cycle statements leaving an OpenMP structured block
program omp_do
integer i, j, k
!$omp parallel
foo: do i = 0, 10
!$omp do
bar: do j = 0, 10
!ERROR: CYCLE to construct 'foo' outside of DO construct is not allowed
cycle foo
end do bar
!$omp end do
end do foo
!$omp end parallel
foo1: do i = 0, 10
!$omp parallel
foo2: do k = 0, 10
!$omp do
foo3: do j = 0, 10
!ERROR: CYCLE to construct 'foo1' outside of PARALLEL construct is not allowed
!ERROR: CYCLE to construct 'foo1' outside of DO construct is not allowed
cycle foo1
end do foo3
!$omp end do
end do foo2
!$omp end parallel
end do foo1
bar1: do i = 0, 10
!$omp parallel
bar2: do k = 0, 10
bar3: do j = 0, 10
!ERROR: CYCLE to construct 'bar1' outside of PARALLEL construct is not allowed
cycle bar1
end do bar3
end do bar2
!$omp end parallel
end do bar1
end program omp_do