llvm-project/flang/test/Semantics/omp-default02.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

58 lines
1.5 KiB
Fortran

!RUN: %S/test_errors.sh %s %t %flang -fopenmp
! OpenMP Version 4.5
! 2.15.3.1 default Clause - a positive test case.
!DEF: /omp_default MainProgram
program omp_default
!DEF: /omp_default/a ObjectEntity INTEGER(4)
!DEF: /omp_default/b ObjectEntity INTEGER(4)
!DEF: /omp_default/c ObjectEntity INTEGER(4)
!DEF: /omp_default/i ObjectEntity INTEGER(4)
!DEF: /omp_default/k ObjectEntity INTEGER(4)
integer a(10), b(10), c(10), i, k
!$omp parallel default(shared)
!DEF: /omp_default/Block1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
do i=1,10
!REF: /omp_default/c
!REF: /omp_default/Block1/i
!REF: /omp_default/a
!REF: /omp_default/b
!REF: /omp_default/k
c(i) = a(i)+b(i)+k
end do
!$omp end parallel
!$omp task default(shared)
!DEF: /omp_default/Block2/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
do i=1,10
!REF: /omp_default/c
!REF: /omp_default/Block2/i
!REF: /omp_default/a
!REF: /omp_default/b
!REF: /omp_default/k
c(i) = a(i)+b(i)+k
end do
!$omp end task
!$omp taskloop default(shared)
!DEF: /omp_default/Block3/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
do i=1,10
!REF: /omp_default/c
!REF: /omp_default/Block3/i
!REF: /omp_default/a
!REF: /omp_default/b
!REF: /omp_default/k
c(i) = a(i)+b(i)+k
end do
!$omp end taskloop
!$omp teams default(shared)
!REF: /omp_default/i
do i=1,10
!REF: /omp_default/c
!REF: /omp_default/i
!REF: /omp_default/a
!REF: /omp_default/b
!REF: /omp_default/k
c(i) = a(i)+b(i)+k
end do
!$omp end teams
end program omp_default