Skip to content

Commit 96e37d3

Browse files
committed
tests: Add tests for inline assembler beq_n and beq_w ops.
1 parent 9f142f0 commit 96e37d3

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

tests/inlineasm/asmbcc.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# test bcc instructions
2+
# at the moment only tests beq, narrow and wide versions
3+
4+
@micropython.asm_thumb
5+
def f(r0):
6+
mov(r1, r0)
7+
8+
mov(r0, 10)
9+
cmp(r1, 1)
10+
beq(end)
11+
12+
mov(r0, 20)
13+
cmp(r1, 2)
14+
beq_n(end)
15+
16+
mov(r0, 30)
17+
cmp(r1, 3)
18+
beq_w(end)
19+
20+
mov(r0, 0)
21+
22+
label(end)
23+
24+
print(f(0))
25+
print(f(1))
26+
print(f(2))
27+
print(f(3))

tests/inlineasm/asmbcc.py.exp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
0
2+
10
3+
20
4+
30

0 commit comments

Comments
 (0)