From 5d8af29ed6d8994a5e576cf7e3c9fcf89b132f04 Mon Sep 17 00:00:00 2001
From: Matt Wala <wala1@illinois.edu>
Date: Mon, 6 Feb 2017 16:54:35 -0600
Subject: [PATCH] Add a regression test for #23.

---
 test/test_domain.py | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/test/test_domain.py b/test/test_domain.py
index e01c3a937..50dd4a596 100644
--- a/test/test_domain.py
+++ b/test/test_domain.py
@@ -229,6 +229,40 @@ def test_dependent_loop_bounds_3(ctx_factory):
         list(lp.generate_loop_schedules(knl_bad))
 
 
+def test_dependent_loop_bounds_4():
+    # https://gitlab.tiker.net/inducer/loopy/issues/23
+    import loopy as lp
+
+    loopy_knl = lp.make_kernel(
+        [
+            "{[a]: 0<=a<10}",
+            "{[b]: b_start<=b<b_end}",
+            "{[c,idim]: c_start<=c<c_end and 0<=idim<dim}",
+        ],
+        """
+        for a
+         <> b_start = 1
+         <> b_end = 2
+         for b
+          <> c_start = 1
+          <> c_end = 2
+
+          for c
+           ... nop
+          end
+
+          <>t[idim] = 1
+         end
+        end
+        """,
+        "...",
+        seq_dependencies=True)
+
+    loopy_knl = lp.fix_parameters(loopy_knl, dim=3)
+
+    lp.generate_code_v2(loopy_knl)
+
+
 def test_independent_multi_domain(ctx_factory):
     dtype = np.dtype(np.float32)
     ctx = ctx_factory()
-- 
GitLab