diff --git a/tests/python/test_continue.py b/tests/python/test_continue.py index cdb13d54cd73a..a837112703809 100644 --- a/tests/python/test_continue.py +++ b/tests/python/test_continue.py @@ -147,3 +147,26 @@ def run(a: ti.i32): assert x[0] == 1 run(0) assert x[0] == 0 + + +@test_utils.test() +def test_kernel_continue_in_simple_if(): + img = ti.field(ti.i32, (2, 2)) + + @ti.kernel + def K(): + for i, j in img: + img[i, j] = 0 + if i > 0 or j > 0: + continue + img[i, j] = 1 + + img.fill(2) + K() + + for i in range(2): + for j in range(2): + if i > 0 or j > 0: + assert img[i, j] == 0 + else: + assert img[i, j] == 1