[flang-commits] [flang] Fix reduction on array sections aborting in lowering (PR #209701)
Jack Styles via flang-commits
flang-commits at lists.llvm.org
Wed Jul 15 02:09:12 PDT 2026
================
@@ -0,0 +1,39 @@
+! Regression test for reductions on array *sections* (e.g. a(2:96)).
+!
+! An array section has rank > 0, so it must be lowered using the boxed
+! whole-array reduction (@add_reduction_byref_box_*) and the section applied
+! via hlfir.designate inside the region. It must NOT be routed through the
+! single-element path (uniq_name = "omp.reduction.element"), which only supports
+! rank-0 references and otherwise aborts in PrivateReductionUtils with
+! "creating reduction/privatization init region for unsupported type".
+
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=50 %s -o - | FileCheck %s --implicit-check-not=omp.reduction.element
----------------
Stylie777 wrote:
nit: Usual practise is to place the `RUN` line at the top of the test file.
https://github.com/llvm/llvm-project/pull/209701
More information about the flang-commits
mailing list