Below semantic checks for Taskloop clause mentioned in OpenMP [5.2] specification were missing, this patch contains the semantic checks, corresponding error messages and test cases: OpenMP standard [5.2]: [12.6] Taskloop Construct [Restrictions] Restrictions to the taskloop construct are as follows: • The reduction-modifier must be default. • The conditional lastprivate-modifier must not be specified. Authored-by: shkaushi <sharang.kaushik@amd.com>
25 lines
583 B
Fortran
25 lines
583 B
Fortran
!RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=52
|
|
|
|
subroutine bar()
|
|
integer :: x, i
|
|
x = 1
|
|
!ERROR: REDUCTION modifier on TASKLOOP directive must be DEFAULT
|
|
!ERROR: List item x must appear in EXCLUSIVE or INCLUSIVE clause of an enclosed SCAN directive
|
|
!$omp taskloop reduction(inscan, +:x)
|
|
do i = 1, 100
|
|
x = x + 1
|
|
enddo
|
|
!$omp end taskloop
|
|
end
|
|
|
|
subroutine baz()
|
|
integer :: x, i
|
|
x = 1
|
|
!ERROR: REDUCTION modifier on TASKLOOP directive must be DEFAULT
|
|
!$omp taskloop reduction(task, +:x)
|
|
do i = 1, 100
|
|
x = x + 1
|
|
enddo
|
|
!$omp end taskloop
|
|
end
|