mirror of https://github.com/m-labs/artiq.git
parent
4c552a481e
commit
4e9165fd1d
|
@ -451,6 +451,7 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
||||||
self.current_block = head
|
self.current_block = head
|
||||||
old_continue, self.continue_target = self.continue_target, head
|
old_continue, self.continue_target = self.continue_target, head
|
||||||
cond = self.visit(node.test)
|
cond = self.visit(node.test)
|
||||||
|
cond = self.coerce_to_bool(cond)
|
||||||
post_head = self.current_block
|
post_head = self.current_block
|
||||||
|
|
||||||
break_block = self.add_block("while.break")
|
break_block = self.add_block("while.break")
|
||||||
|
|
|
@ -19,3 +19,9 @@ else:
|
||||||
|
|
||||||
assert (0 if True else 1) == 0
|
assert (0 if True else 1) == 0
|
||||||
assert (0 if False else 1) == 1
|
assert (0 if False else 1) == 1
|
||||||
|
|
||||||
|
if 0:
|
||||||
|
assert True
|
||||||
|
|
||||||
|
if 1:
|
||||||
|
assert True
|
||||||
|
|
|
@ -53,3 +53,10 @@ while True:
|
||||||
assert False
|
assert False
|
||||||
else:
|
else:
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
|
while 0:
|
||||||
|
assert False
|
||||||
|
|
||||||
|
while 1:
|
||||||
|
assert True
|
||||||
|
break
|
||||||
|
|
Loading…
Reference in New Issue