Semantic checks added to check the worksharing 'single' region closely nested inside a worksharing 'do' region. And also to check whether the 'do' iteration variable is a variable in 'Firstprivate' clause. Files: check-directive-structure.h check-omp-structure.h check-omp-structure.cpp Testcases: omp-do01-positivecase.f90 omp-do01.f90 omp-do05-positivecase.f90 omp-do05.f90 Reviewed by: Kiran Chandramohan @kiranchandramohan , Valentin Clement @clementval Differential Revision: https://reviews.llvm.org/D93205
37 lines
884 B
Fortran
37 lines
884 B
Fortran
! RUN: %S/test_symbols.sh %s %t %f18 -fopenmp
|
|
! OpenMP Version 4.5
|
|
! 2.7.1 Loop Construct restrictions on single directive.
|
|
! A positive case
|
|
|
|
!DEF: /omp_do MainProgram
|
|
program omp_do
|
|
!DEF: /omp_do/i ObjectEntity INTEGER(4)
|
|
!DEF: /omp_do/n ObjectEntity INTEGER(4)
|
|
integer i,n
|
|
!$omp parallel
|
|
!DEF: /omp_do/Block1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
|
|
do i=1,10
|
|
!$omp single
|
|
print *, "hello"
|
|
!$omp end single
|
|
end do
|
|
!$omp end parallel
|
|
|
|
!$omp parallel default(shared)
|
|
!$omp do
|
|
!DEF: /omp_do/Block2/Block1/i (OmpPrivate, OmpPreDetermined) HostAssoc INTEGER(4)
|
|
!REF: /omp_do/n
|
|
do i=1,n
|
|
!$omp parallel
|
|
!$omp single
|
|
!DEF: /work EXTERNAL (Subroutine) ProcEntity
|
|
!REF: /omp_do/Block2/Block1/i
|
|
call work(i, 1)
|
|
!$omp end single
|
|
!$omp end parallel
|
|
end do
|
|
!$omp end do
|
|
!$omp end parallel
|
|
|
|
end program omp_do
|