mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Add more test cases for IF, REPT, and MACRO (#748)
This commit is contained in:
27
test/asm/code-after-endm-endr-endc.asm
Normal file
27
test/asm/code-after-endm-endr-endc.asm
Normal file
@@ -0,0 +1,27 @@
|
||||
println "start"
|
||||
|
||||
; will not define 'mac'
|
||||
mac: MACRO
|
||||
println \1
|
||||
ENDM println "<_<"
|
||||
mac "argument"
|
||||
|
||||
; will not repeat
|
||||
REPT 3
|
||||
println "hey!"
|
||||
ENDR println "<_<"
|
||||
|
||||
IF 0
|
||||
println "skipped"
|
||||
bad syntax!?
|
||||
ELSE println "<_<"
|
||||
println "else clause"
|
||||
ENDC println "<_<"
|
||||
|
||||
IF 1
|
||||
println "if clause"
|
||||
ELSE println "<_<"
|
||||
println "not skipped"
|
||||
ENDC println "<_<"
|
||||
|
||||
println "done"
|
||||
15
test/asm/code-after-endm-endr-endc.err
Normal file
15
test/asm/code-after-endm-endr-endc.err
Normal file
@@ -0,0 +1,15 @@
|
||||
ERROR: code-after-endm-endr-endc.asm(6):
|
||||
syntax error, unexpected PRINTLN, expecting newline
|
||||
ERROR: code-after-endm-endr-endc.asm(7):
|
||||
Macro "mac" not defined
|
||||
ERROR: code-after-endm-endr-endc.asm(12):
|
||||
syntax error, unexpected PRINTLN, expecting newline
|
||||
ERROR: code-after-endm-endr-endc.asm(17):
|
||||
syntax error, unexpected PRINTLN, expecting newline
|
||||
ERROR: code-after-endm-endr-endc.asm(19):
|
||||
syntax error, unexpected PRINTLN, expecting end of file or newline
|
||||
ERROR: code-after-endm-endr-endc.asm(23):
|
||||
syntax error, unexpected PRINTLN, expecting newline
|
||||
ERROR: code-after-endm-endr-endc.asm(25):
|
||||
syntax error, unexpected PRINTLN, expecting end of file or newline
|
||||
error: Assembly aborted (7 errors)!
|
||||
5
test/asm/code-after-endm-endr-endc.out
Normal file
5
test/asm/code-after-endm-endr-endc.out
Normal file
@@ -0,0 +1,5 @@
|
||||
start
|
||||
else clause
|
||||
if clause
|
||||
not skipped
|
||||
done
|
||||
18
test/asm/multiple-else.asm
Normal file
18
test/asm/multiple-else.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
if 0
|
||||
println "zero"
|
||||
else
|
||||
println "one"
|
||||
if 1
|
||||
println "A"
|
||||
else
|
||||
println "B"
|
||||
else
|
||||
println "C"
|
||||
else
|
||||
println "D"
|
||||
endc
|
||||
else
|
||||
println "two"
|
||||
else
|
||||
println "three"
|
||||
endc
|
||||
0
test/asm/multiple-else.err
Normal file
0
test/asm/multiple-else.err
Normal file
2
test/asm/multiple-else.out
Normal file
2
test/asm/multiple-else.out
Normal file
@@ -0,0 +1,2 @@
|
||||
one
|
||||
A
|
||||
Reference in New Issue
Block a user