[flang-commits] [flang] [flang] Guard absent optional operands in elemental character MIN/MAX (PR #191244)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Mon Apr 13 06:14:06 PDT 2026
================
@@ -70,60 +70,3 @@ subroutine test_elemental_char_min_three(a, b, c, res)
! CHECK: %{{.*}} = hlfir.char_extremum min, %{{.*}}, %{{.*}}, %{{.*}} :
! CHECK: hlfir.yield_element
! CHECK: }
-
----------------
eugeneepshteyn wrote:
AI code reviewer had to say the following here. Could you please check if this makes sense?
### Two valid lowering tests removed without replacement
The two removed tests (`test_elemental_char_min_optional`, `test_elemental_char_min_assumed_optional`) check the code generated by `computeDynamicCharacterResultLength` and the outer `hlfir.elemental` structure — both of which are unchanged by this PR. Their CHECK patterns end at the `hlfir.elemental` declaration and do **not** inspect the loop body (no `^bb0` checks), so they are unaffected by the change to the kernel. They will still pass after this PR is applied.
Removing them silently drops test coverage for the `fir.if`-guarded result-length computation that was the whole point of PR #189464. If those tests were broken by this change, they should be updated; if they still pass (as they appear to), they should be kept and optionally extended to also verify the inner kernel.
https://github.com/llvm/llvm-project/pull/191244
More information about the flang-commits
mailing list