mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
23
test/asm/elif-after-taken-if.asm
Normal file
23
test/asm/elif-after-taken-if.asm
Normal file
@@ -0,0 +1,23 @@
|
||||
if 1
|
||||
println "taken if"
|
||||
elif 2 / 0 ; avoided fatal "Division by zero" error
|
||||
println "untaken elif"
|
||||
elif 3 / 0 ; avoided fatal "Division by zero" error
|
||||
println "untaken after untaken"
|
||||
endc
|
||||
|
||||
if 0
|
||||
println "untaken if"
|
||||
elif 1
|
||||
println "taken elif"
|
||||
elif !@#$ ; avoided fatal syntax error
|
||||
println "untaken elif"
|
||||
elif %^&* ; avoided fatal syntax error
|
||||
println "untaken after untaken"
|
||||
endc
|
||||
|
||||
if 0
|
||||
println "untaken if"
|
||||
elif 1 / 0 ; fatal "Division by zero" error
|
||||
println "unreached elif"
|
||||
endc
|
||||
2
test/asm/elif-after-taken-if.err
Normal file
2
test/asm/elif-after-taken-if.err
Normal file
@@ -0,0 +1,2 @@
|
||||
FATAL: elif-after-taken-if.asm(21):
|
||||
Division by zero
|
||||
2
test/asm/elif-after-taken-if.out
Normal file
2
test/asm/elif-after-taken-if.out
Normal file
@@ -0,0 +1,2 @@
|
||||
taken if
|
||||
taken elif
|
||||
@@ -3,7 +3,7 @@ mac: MACRO
|
||||
println "small \1"
|
||||
elif (\1) > 100
|
||||
println "large \1"
|
||||
elif (\1) / 0 == 42 ; only evaluated if the "large" condition was taken
|
||||
elif (\1) / 0 == 42 ; only evaluated if neither "small" nor "large" was taken
|
||||
println "division by zero!?"
|
||||
elif syntax! error?
|
||||
println "X_X"
|
||||
@@ -15,3 +15,4 @@ ENDM
|
||||
mac 2 + 2
|
||||
mac STRLEN("abcdef")
|
||||
mac 101
|
||||
mac 23
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
FATAL: skip-elif-condition.asm(17) -> skip-elif-condition.asm::mac(6):
|
||||
FATAL: skip-elif-condition.asm(18) -> skip-elif-condition.asm::mac(6):
|
||||
Division by zero
|
||||
|
||||
Reference in New Issue
Block a user