aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bad_jal.s18
-rw-r--r--tests/expected/bad_jal.txt2
-rw-r--r--tests/jal.s3
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/bad_jal.s b/tests/bad_jal.s
new file mode 100644
index 0000000..693fa7d
--- /dev/null
+++ b/tests/bad_jal.s
@@ -0,0 +1,18 @@
+.segment "HEADER"
+ .byte 'N', 'E', 'S', $1A
+ .byte $02
+ .byte $01
+ .byte $00
+ .byte $00
+
+.segment "CODE"
+
+.include "jal.s"
+
+.proc foo
+ JAL bar
+.endproc
+
+.proc bar
+ rts
+.endproc
diff --git a/tests/expected/bad_jal.txt b/tests/expected/bad_jal.txt
new file mode 100644
index 0000000..1b3f315
--- /dev/null
+++ b/tests/expected/bad_jal.txt
@@ -0,0 +1,2 @@
+warning: unconditional jump that points to the next instruction (jal.s: line 2)
+ >> expanded from bad_jal.s: line 13.
diff --git a/tests/jal.s b/tests/jal.s
new file mode 100644
index 0000000..90f8a15
--- /dev/null
+++ b/tests/jal.s
@@ -0,0 +1,3 @@
+.macro JAL ADDR
+ jmp ADDR
+.endmacro