llvm-project/flang/test/Semantics/omp-do-cycle.f90
Faris Rehman 6d48a1a53f [flang][driver] Add support for -fopenmp and -fopenacc
Add support for the following options:
* -fopenmp
* -fopenacc

Update OpenMP and OpenACC semantics tests to use the new driver if it is built, otherwise use f18.
OpenMP tests that include `use omp_lib` or run `test_symbols.sh` have not been updated as they require options `-intrinsic-module-directory` and `-funparse-with-symbols` which are currently not implemented in the new driver.
Similarly OpenACC tests that run `test_symbols.sh` have not been updated.

This patch also moves semanticsContext to CompilerInvocation and creates it in CompilerInvocation#setSemanticsOpts so that the semantics context can use Fortran::parser::Options#features.

Summary of changes:
- Move semanticsContext to CompilerInvocation.h
- Update OpenMP and OpenACC semantics tests that do not rely on `-intrinsic-module-directory` and `-funparse-with-symbols` to use %flang

Differential Revision: https://reviews.llvm.org/D96032
2021-02-10 09:59:35 +00:00

45 lines
1.1 KiB
Fortran

! RUN: %S/test_errors.sh %s %t %flang -fopenmp
! 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