mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Add test case for FOR loop variable reusing an existing one
This commit is contained in:
13
test/asm/for-loop-variable.asm
Normal file
13
test/asm/for-loop-variable.asm
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
def x = 4
|
||||||
|
for x, x
|
||||||
|
def x *= 2
|
||||||
|
println x
|
||||||
|
endr
|
||||||
|
println x
|
||||||
|
|
||||||
|
def y equ 5
|
||||||
|
for y, y
|
||||||
|
def y *= 3
|
||||||
|
println y
|
||||||
|
endr
|
||||||
|
println y
|
||||||
3
test/asm/for-loop-variable.err
Normal file
3
test/asm/for-loop-variable.err
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
error: for-loop-variable.asm(12):
|
||||||
|
'y' already defined as constant at for-loop-variable.asm(8)
|
||||||
|
error: Assembly aborted (1 error)!
|
||||||
6
test/asm/for-loop-variable.out
Normal file
6
test/asm/for-loop-variable.out
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
$0
|
||||||
|
$2
|
||||||
|
$4
|
||||||
|
$6
|
||||||
|
$4
|
||||||
|
$5
|
||||||
Reference in New Issue
Block a user