diff --git a/tests/python/unittest/test_arith_intset.py b/tests/python/unittest/test_arith_intset.py index 9ca6cb8e0273..ca9d1077feb2 100644 --- a/tests/python/unittest/test_arith_intset.py +++ b/tests/python/unittest/test_arith_intset.py @@ -322,6 +322,23 @@ def do_test_point_access(point, predicates, var_dom, expect): ) +def test_region_lower_bound_unfusable(): + # This test is designed to trigger an error in DetectIterMap, + # resulting from a numerator which required multiple input + # variables. The bug resulted in an exception being thrown, + # rather than a return value of None. + var_dom = { + tvm.tir.Var("i", "int32"): tvm.ir.Range(8), + tvm.tir.Var("j", "int32"): tvm.ir.Range(4), + } + i, j = var_dom + region = [ + tvm.ir.Range.from_min_extent((i + j) // 2, 1), + ] + result = tvm.arith.estimate_region_lower_bound(region, var_dom, predicate=True) + assert result is None + + def test_union_lower_bound(): neg_inf = tvm.arith.int_set.neg_inf() pos_inf = tvm.arith.int_set.pos_inf()