2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-22 18:04:03 +08:00
artiq/lit-test/test/iodelay/error_control_flow.py

24 lines
600 B
Python

# RUN: %python -m artiq.compiler.testbench.signature +diag +delay %s >%t
# RUN: OutputCheck %s --file-to-check=%t
def f():
# CHECK-L: ${LINE:+1}: error: while statement cannot be interleaved
while True:
delay_mu(1)
def g():
# CHECK-L: ${LINE:+1}: error: if statement cannot be interleaved
if True:
delay_mu(1)
def h():
# CHECK-L: ${LINE:+1}: error: if expression cannot be interleaved
delay_mu(1) if True else delay_mu(2)
def i():
# CHECK-L: ${LINE:+1}: error: try statement cannot be interleaved
try:
delay_mu(1)
finally:
pass