aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bad_fallthrough.s27
-rw-r--r--tests/expected/bad_fallthrough.txt4
-rw-r--r--tests/expected/fallthrough.nesbin0 -> 21 bytes
-rw-r--r--tests/expected/fallthrough.txt0
-rw-r--r--tests/fallthrough.s23
5 files changed, 54 insertions, 0 deletions
diff --git a/tests/bad_fallthrough.s b/tests/bad_fallthrough.s
new file mode 100644
index 0000000..ac17ade
--- /dev/null
+++ b/tests/bad_fallthrough.s
@@ -0,0 +1,27 @@
+.segment "HEADER"
+ .byte 'N', 'E', 'S', $1A
+ .byte $02, $01
+ .byte $00
+ .byte $00
+
+.segment "CODE"
+
+.proc foo
+ lda #0
+ .fallthrough bar
+.endproc
+
+.fallthrough bar
+.fallthrough other
+ lda #0
+
+.proc bar
+ lda #0
+ .fallthrough other
+.endproc
+
+.proc other
+ rts
+.endproc
+
+.fallthrough other
diff --git a/tests/expected/bad_fallthrough.txt b/tests/expected/bad_fallthrough.txt
new file mode 100644
index 0000000..f105880
--- /dev/null
+++ b/tests/expected/bad_fallthrough.txt
@@ -0,0 +1,4 @@
+error: statement does not fall through (bad_fallthrough.s: line 11)
+error: statement does not fall through (bad_fallthrough.s: line 14)
+error: statement does not fall through (bad_fallthrough.s: line 15)
+error: statement does not fall through (bad_fallthrough.s: line 27)
diff --git a/tests/expected/fallthrough.nes b/tests/expected/fallthrough.nes
new file mode 100644
index 0000000..976f8fc
--- /dev/null
+++ b/tests/expected/fallthrough.nes
Binary files differ
diff --git a/tests/expected/fallthrough.txt b/tests/expected/fallthrough.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/expected/fallthrough.txt
diff --git a/tests/fallthrough.s b/tests/fallthrough.s
new file mode 100644
index 0000000..2340ee8
--- /dev/null
+++ b/tests/fallthrough.s
@@ -0,0 +1,23 @@
+.segment "HEADER"
+ .byte 'N', 'E', 'S', $1A
+ .byte $02, $01
+ .byte $00
+ .byte $00
+
+.segment "CODE"
+
+.proc foo
+ lda #0
+ .fallthrough bar
+.endproc
+
+.fallthrough bar
+
+.proc bar
+ lda #0
+ .fallthrough other
+.endproc
+
+.proc other
+ rts
+.endproc