Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-hitonami committed Nov 5, 2021
1 parent 7e33579 commit 91782b9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/python/test_ast_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 91782b9

Please sign in to comment.