ref: 95cd0c6e53e48648cc6cd51ef846371d1365de57
parent: 23ab245ceca3238b8126ead77adcd6275a528077
author: ISSOtm <[email protected]>
date: Sun Jan 12 08:09:27 EST 2020
Add test for BANK() in constant context
--- /dev/null
+++ b/test/asm/bank.asm
@@ -1,0 +1,23 @@
+def_sect: macro
+ IF _NARG == 2
+ SECTION "\1", \2
+ ELSE
+ SECTION "\1", \2, BANK[\3]
+ ENDC
+
+ PRINTV BANK("\1")
+ PRINTT "\n"
+endm
+
+ def_sect ROM0_ok, ROM0
+ def_sect ROMX_ok, ROMX, 42
+ def_sect ROMX_bad, ROMX
+ def_sect VRAM_ok, VRAM, 1
+ def_sect VRAM_bad, VRAM
+ def_sect SRAM_ok, SRAM, 4
+ def_sect SRAM_bad, SRAM
+ def_sect WRAM0_ok, WRAM0
+ def_sect WRAMX_ok, WRAMX, 7
+ def_sect WRAMX_bad,WRAMX
+ def_sect OAM_ok, OAM
+ def_sect HRAM_ok, HRAM
--- /dev/null
+++ b/test/asm/bank.err
@@ -1,0 +1,9 @@
+ERROR: bank.asm(14) -> bank.asm::def_sect(8):
+ Section "ROMX_bad"'s bank is not known yet
+ERROR: bank.asm(16) -> bank.asm::def_sect(8):
+ Section "VRAM_bad"'s bank is not known yet
+ERROR: bank.asm(18) -> bank.asm::def_sect(8):
+ Section "SRAM_bad"'s bank is not known yet
+ERROR: bank.asm(21) -> bank.asm::def_sect(8):
+ Section "WRAMX_bad"'s bank is not known yet
+error: Assembly aborted (4 errors)!
--- /dev/null
+++ b/test/asm/bank.out
@@ -1,0 +1,12 @@
+$0
+$2A
+$0
+$1
+$0
+$4
+$0
+$0
+$7
+$0
+$0
+$0