diff --git a/tests/python/test_ast_refactor.py b/tests/python/test_ast_refactor.py index 22f4dd454516b..481f2561f7e3f 100644 --- a/tests/python/test_ast_refactor.py +++ b/tests/python/test_ast_refactor.py @@ -596,6 +596,25 @@ def func(): assert ret[None] == 55 +@ti.test(experimental_ast_refactor=True) +def test_while_continue(): + ret = ti.field(ti.i32, shape=()) + + @ti.kernel + def func(): + i = 0 + s = 0 + while i < 10: + i += 1 + if i % 2 == 0: + continue + s += i + ret[None] = s + + func() + assert ret[None] == 25 + + @ti.test(experimental_ast_refactor=True, print_preprocessed_ir=True) def test_func(): @ti.func