xref: /llvm-project/flang/test/Semantics/OpenMP/map-clause.f90 (revision 52755ac2531529369f1f29b9d0b29645f304f389)
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=52
2! Check OpenMP MAP clause validity. Section 5.8.3 OpenMP 5.2.
3
4subroutine sb(arr)
5  implicit none
6  real(8) :: arr(*)
7  real :: a
8  integer:: b, c, i
9  common /var/ b, c
10
11  !ERROR: Assumed-size whole arrays may not appear on the MAP clause
12  !$omp target map(arr)
13  do i = 1, 100
14     a = 3.14
15  enddo
16  !$omp end target
17
18  !ERROR: Assumed-size array 'arr' must have explicit final subscript upper bound value
19  !$omp target map(arr(:))
20  do i = 1, 100
21     a = 3.14
22  enddo
23  !$omp end target
24
25  !$omp target map(arr(3:5))
26  do i = 1, 100
27     a = 3.14
28  enddo
29  !$omp end target
30
31 !$omp target map(tofrom: /var/)
32   b = 1
33   c = 2
34 !$omp end target
35end subroutine
36
37subroutine sb1
38  integer :: xx
39  integer :: a
40  !ERROR: Name 'xx' should be a mapper name
41  !$omp target map(mapper(xx), from:a)
42  !$omp end target
43end subroutine sb1
44