We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0160210 commit 551723eCopy full SHA for 551723e
test/qasm2/test_lowering.py
@@ -1,5 +1,7 @@
1
import textwrap
2
3
+from kirin.dialects import func
4
+
5
from bloqade import qasm2
6
from bloqade.qasm2.parse.lowering import QASM2
7
@@ -17,6 +19,17 @@
17
19
rx(pi/2) q[0];
18
20
"""
21
)
-ast = qasm2.parse.loads(lines)
-code = QASM2(qasm2.main).run(ast)
22
-code.print()
23
24
+def test_run_lowering():
25
+ ast = qasm2.parse.loads(lines)
26
+ code = QASM2(qasm2.main).run(ast)
27
+ code.print()
28
29
30
+def test_loads():
31
32
+ kernel = QASM2(qasm2.main).loads(lines, "test", returns="c")
33
+ qasm2.main.run_pass(kernel) # type: ignore
34
+ assert isinstance((ret := kernel.callable_region.blocks[0].last_stmt), func.Return)
35
+ assert ret.value.type.is_equal(qasm2.types.CRegType)
0 commit comments