Files
clang-p2996/flang/test/Semantics/OpenMP/reduction15.f90
Krzysztof Parzyszek 02db35a1d6 [flang][OpenMP] Implement CheckReductionObjects for all reduction c… (#118689)
…lauses

Currently we only do semantic checks for REDUCTION. There are two other
clauses, IN_REDUCTION, and TASK_REDUCTION which will also need those
checks. Implement a function that checks the common list-item
requirements for all those clauses.
2024-12-06 12:00:48 -06:00

33 lines
750 B
Fortran

!RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp -fopenmp-version=50
!Ref: [5.0:297:28-29]
! If a list item is an array section or an array element, its base expression
! must be a base language identifier.
module m
type t
integer :: a(10)
end type
contains
subroutine f00
type(t) :: x
!ERROR: The base expression of an array element or section in REDUCTION clause must be an identifier
!$omp do reduction (+ : x%a(2))
do i = 1, 10
end do
!$omp end do
end subroutine
subroutine f01
type(t) :: x
!ERROR: The base expression of an array element or section in REDUCTION clause must be an identifier
!$omp do reduction (+ : x%a(1:10))
do i = 1, 10
end do
!$omp end do
end subroutine
end