[flang-commits] [flang] [Flang][OpenMP] Reject array sections and subobjects in LINEAR clause (PR #197430)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Wed May 27 06:21:47 PDT 2026
================
@@ -0,0 +1,64 @@
+! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
+! Verify that array sections and array elements in LINEAR clause are rejected.
+! The LINEAR clause requires a scalar variable name (OpenMP 4.5 ยง2.15.3.7).
+
+subroutine test_array_section_in_linear()
+ implicit none
+ integer :: i
+ integer, dimension(0:99, -99:10, 200) :: a, b, c
+
+ !$omp parallel
+ !ERROR: A variable that is part of another variable (as an array or structure element) cannot appear in a LINEAR clause
+ !$omp do linear(a(:,1,1))
----------------
tblah wrote:
Thanks for your help both. Agreed.
https://github.com/llvm/llvm-project/pull/197430
More information about the flang-commits
mailing list