[flang-commits] [flang] [Flang][OpenMP] Parse and semantically analyze common blocks in map clauses correctly (PR #89847)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Fri Apr 26 12:12:13 PDT 2024


================
@@ -2,16 +2,20 @@
 ! 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
----------------
kkwli wrote:

As far as I know, the OpenMP array section syntax does not extend any Fortran array section syntax. The OpenMP spec only restricts where (clause or directive) the array section can appear. So I think the restriction, 

>"The second subscript shall not be omitted from a subscript-triplet in the last dimension of an assumed-size array."

is repeating C930. I will double check on it.

https://github.com/llvm/llvm-project/pull/89847


More information about the flang-commits mailing list