Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jim19930609 committed Jun 1, 2023
1 parent 41117f5 commit da6255e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/python/test_continue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit da6255e

Please sign in to comment.