Skip to content

Commit c29b7a2

Browse files
committed
add compat tests for relative jumps with immediate offset from absolute symbol
Values assigned to symbols using .set should be specified in words (not bytes). Thus, this test ensures that the value of the const symbol is not converted to words (divided by 4). Since py-esp32-ulp internally tracks symbol values as words anyway, this behaviour has been correct all along. The test aims to show that recent changes related to immediate value handling did not break this (and to guard against future changes that could break this).
1 parent 7eda90c commit c29b7a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: tests/compat/jumps.S

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.text
2+
.set const, 3
3+
.global const # exporting symbol is required for binutils, not important for py-esp32-ulp
24

35
entry:
46
nop
@@ -27,6 +29,9 @@ entry:
2729
jumps -8, 42, lt
2830
jumps -32, 42, lt
2931

32+
# jumps with immediate offset from absolute symbol
33+
jumps const, 42, lt
34+
3035
# jumpr with labels
3136
jumpr entry, 42, lt
3237
jumpr later, 42, lt
@@ -50,6 +55,9 @@ entry:
5055
jumpr -8, 42, lt
5156
jumpr -32, 42, lt
5257

58+
# jumps with immediate offset from absolute symbol
59+
jumpr const, 42, lt
60+
5361
nop
5462
nop
5563
nop

0 commit comments

Comments
 (0)