Эх сурвалжийг харах

test: add test for rodata array fix

Claire xyz 1 сар өмнө
parent
commit
cc945b5596

+ 4 - 0
crates/assembler/tests/fixtures/index.toml

@@ -13,3 +13,7 @@ hash = "7be6d8971386a6fb59845d0353d688183677b3115cc683cddfc2d636efa01bc0"
 [cases.rodata]
 file = "rodata.s"
 hash = "b5bf26be95f734324c4aeb29ec94ac6456e051ad931f6167a391f64fde9a0647"
+
+[cases.ro_bytearray]
+file = "ro_bytearray.s"
+hash = "f2967906640257efdddd7684bd818109efb2857af8a3bb2bff1578c47265481f" 

+ 13 - 0
crates/assembler/tests/fixtures/ro_bytearray.s

@@ -0,0 +1,13 @@
+.rodata
+  x: .byte 0, 0x01, 2, 0x10
+
+.text
+.globl entrypoint
+entrypoint:
+  lddw r6, x
+  ldxb r1, [r6 + 0]   # Load x[0] into r1
+  ldxb r2, [r6 + 1]   # Load x[1] into r2
+  ldxb r3, [r6 + 2]   # Load x[2] into r3
+  ldxb r4, [r6 + 3]   # Load x[3] into r4
+  call sol_log_64_
+  exit