[flang-commits] [flang] [flang] Fix null pointer dereference in OUT_OF_RANGE folding (PR #224270)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Mon Oct 12 19:51:21 PDT 2026
================
@@ -0,0 +1,17 @@
+! RUN: %python %S/test_folding.py %s %flang_fc1 -fdefault-integer-8
+
+! Verify that folding OUT_OF_RANGE works when the default integer and
+! logical kinds are promoted to kind 8.
+
+module test_out_of_range_default_integer_8
+ integer, parameter :: i1 = selected_int_kind(2)
+ integer, parameter :: wp = selected_real_kind(6)
+
+ logical, parameter :: expected(*) = &
+ [.false., .true., .false., .true.]
+
+ logical, parameter :: result(*) = out_of_range( &
+ [127.0_wp, 128.0_wp, -128.0_wp, -129.0_wp], 0_i1)
----------------
eugeneepshteyn wrote:
Could you also keep a small test that doesn't need REAL(16)? My suggestion missed the `flang-supports-f128-math` requirement: the Linux premerge run for this revision reports `fold-out_of_range.f90` as unsupported ("Missing required feature(s): flang-supports-f128-math"), so the new kind-8 RUN line isn't exercised there. The `fold-out-of-range-integer-8.f90` you had before would do; it aborts without the fix and passes with it.
https://github.com/llvm/llvm-project/pull/224270
More information about the flang-commits
mailing list