Files
clang-p2996/flang/test/Semantics/OpenMP/map-clause.f90
Krzysztof Parzyszek 52755ac253 [flang][OpenMP] Use new modifier infrastructure for MAP/FROM/TO clauses (#117447)
This removes the specialized parsers and helper classes for these
clauses, namely ConcatSeparated, MapModifiers, and MotionModifiers. Map
and the motion clauses are now handled in the same way as all other
clauses with modifiers, with one exception: the commas separating their
modifiers are optional. This syntax is deprecated in OpenMP 5.2.

Implement version checks for modifiers: for a given modifier on a given
clause, check if that modifier is allowed on this clause in the
specified OpenMP version. This replaced several individual checks.

Add a testcase for handling map modifiers in a different order, and for
diagnosing an ultimate modifier out of position.
2024-11-25 07:38:12 -06:00

44 lines
913 B
Fortran

! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=52
! Check OpenMP MAP clause validity. Section 5.8.3 OpenMP 5.2.
subroutine sb(arr)
implicit none
real(8) :: arr(*)
real :: a
integer:: b, c, i
common /var/ b, c
!ERROR: Assumed-size whole arrays may not appear on the MAP clause
!$omp target map(arr)
do i = 1, 100
a = 3.14
enddo
!$omp end target
!ERROR: Assumed-size array 'arr' must have explicit final subscript upper bound value
!$omp target map(arr(:))
do i = 1, 100
a = 3.14
enddo
!$omp end target
!$omp target map(arr(3:5))
do i = 1, 100
a = 3.14
enddo
!$omp end target
!$omp target map(tofrom: /var/)
b = 1
c = 2
!$omp end target
end subroutine
subroutine sb1
integer :: xx
integer :: a
!ERROR: Name 'xx' should be a mapper name
!$omp target map(mapper(xx), from:a)
!$omp end target
end subroutine sb1