diff --git a/test/link/script-different-bank.link b/test/link/script-different-bank.link new file mode 100644 index 00000000..9d371957 --- /dev/null +++ b/test/link/script-different-bank.link @@ -0,0 +1,2 @@ +romx 2 + "ROM1" diff --git a/test/link/script-different-bank.out b/test/link/script-different-bank.out new file mode 100644 index 00000000..08c9278a --- /dev/null +++ b/test/link/script-different-bank.out @@ -0,0 +1,2 @@ +error: script-different-bank.link(2): The linker script places section "ROM1" in ROMX bank 2, but it was already defined in bank 1 +Linking failed with 1 error diff --git a/test/link/script-different-type.link b/test/link/script-different-type.link new file mode 100644 index 00000000..55711d84 --- /dev/null +++ b/test/link/script-different-type.link @@ -0,0 +1,2 @@ +sram 1 + "ROM1" diff --git a/test/link/script-different-type.out b/test/link/script-different-type.out new file mode 100644 index 00000000..004f0b2d --- /dev/null +++ b/test/link/script-different-type.out @@ -0,0 +1,2 @@ +error: script-different-type.link(2): "ROM1" is specified to be a SRAM section, but it is already a ROMX section +Linking failed with 1 error diff --git a/test/link/script-lone-dollar.link b/test/link/script-lone-dollar.link new file mode 100644 index 00000000..4e037557 --- /dev/null +++ b/test/link/script-lone-dollar.link @@ -0,0 +1 @@ +vram $ diff --git a/test/link/script-lone-dollar.out b/test/link/script-lone-dollar.out new file mode 100644 index 00000000..d1ac75f4 --- /dev/null +++ b/test/link/script-lone-dollar.out @@ -0,0 +1,2 @@ +error: script-lone-dollar.link(1): No hexadecimal digits found after '$' +Linking failed with 1 error diff --git a/test/link/script-lone-percent.link b/test/link/script-lone-percent.link new file mode 100644 index 00000000..ae861072 --- /dev/null +++ b/test/link/script-lone-percent.link @@ -0,0 +1 @@ +vram % diff --git a/test/link/script-lone-percent.out b/test/link/script-lone-percent.out new file mode 100644 index 00000000..f95c5d5d --- /dev/null +++ b/test/link/script-lone-percent.out @@ -0,0 +1,2 @@ +error: script-lone-percent.link(1): No binary digits found after '%' +Linking failed with 1 error diff --git a/test/link/script-missing-bank-no.link b/test/link/script-missing-bank-no.link new file mode 100644 index 00000000..b45b2eba --- /dev/null +++ b/test/link/script-missing-bank-no.link @@ -0,0 +1,8 @@ +rom0 +romx +vram +sram +wram0 +wramx +oam +hram diff --git a/test/link/script-missing-bank-no.out b/test/link/script-missing-bank-no.out new file mode 100644 index 00000000..e3cced81 --- /dev/null +++ b/test/link/script-missing-bank-no.out @@ -0,0 +1,5 @@ +error: script-missing-bank-no.link(2): A bank number must be specified for ROMX +error: script-missing-bank-no.link(3): A bank number must be specified for VRAM +error: script-missing-bank-no.link(4): A bank number must be specified for SRAM +error: script-missing-bank-no.link(6): A bank number must be specified for WRAMX +Linking failed with 4 errors diff --git a/test/link/script-num-fmt.link b/test/link/script-num-fmt.link new file mode 100644 index 00000000..1465027b --- /dev/null +++ b/test/link/script-num-fmt.link @@ -0,0 +1,5 @@ +ROM0 + org 42 + org %101010 + org $2A + org 41 ; Error! diff --git a/test/link/script-num-fmt.out b/test/link/script-num-fmt.out new file mode 100644 index 00000000..6e3ca3ec --- /dev/null +++ b/test/link/script-num-fmt.out @@ -0,0 +1,2 @@ +error: script-num-fmt.link(5): Cannot decrease the current address (from $002a to $0029) +Linking failed with 1 error diff --git a/test/link/script-oob-bank-num.link b/test/link/script-oob-bank-num.link new file mode 100644 index 00000000..0fcc81a3 --- /dev/null +++ b/test/link/script-oob-bank-num.link @@ -0,0 +1,8 @@ +rom0 1 +romx 0 +vram 2 +wram0 1 +wramx 0 +wramx 8 +oam 1 +hram 1 diff --git a/test/link/script-oob-bank-num.out b/test/link/script-oob-bank-num.out new file mode 100644 index 00000000..f798a23d --- /dev/null +++ b/test/link/script-oob-bank-num.out @@ -0,0 +1,9 @@ +error: script-oob-bank-num.link(1): ROM0 bank 1 doesn't exist (the maximum is 0) +error: script-oob-bank-num.link(2): ROMX bank 0 doesn't exist (the minimum is 1) +error: script-oob-bank-num.link(3): VRAM bank 2 doesn't exist (the maximum is 1) +error: script-oob-bank-num.link(4): WRAM0 bank 1 doesn't exist (the maximum is 0) +error: script-oob-bank-num.link(5): WRAMX bank 0 doesn't exist (the minimum is 1) +error: script-oob-bank-num.link(6): WRAMX bank 8 doesn't exist (the maximum is 7) +error: script-oob-bank-num.link(7): OAM bank 1 doesn't exist (the maximum is 0) +error: script-oob-bank-num.link(8): HRAM bank 1 doesn't exist (the maximum is 0) +Linking failed with 8 errors diff --git a/test/link/script-unk-keyword.link b/test/link/script-unk-keyword.link new file mode 100644 index 00000000..1cd909e0 --- /dev/null +++ b/test/link/script-unk-keyword.link @@ -0,0 +1 @@ +bonjour diff --git a/test/link/script-unk-keyword.out b/test/link/script-unk-keyword.out new file mode 100644 index 00000000..a395bdbd --- /dev/null +++ b/test/link/script-unk-keyword.out @@ -0,0 +1,2 @@ +error: script-unk-keyword.link(1): Unknown keyword "bonjour" +Linking failed with 1 error diff --git a/test/link/script-unknown-section.link b/test/link/script-unknown-section.link new file mode 100644 index 00000000..04124107 --- /dev/null +++ b/test/link/script-unknown-section.link @@ -0,0 +1,2 @@ +rom0 + "Wheeee" diff --git a/test/link/script-unknown-section.out b/test/link/script-unknown-section.out new file mode 100644 index 00000000..cc07471c --- /dev/null +++ b/test/link/script-unknown-section.out @@ -0,0 +1,2 @@ +error: script-unknown-section.link(2): Unknown section "Wheeee" +Linking failed with 1 error diff --git a/test/link/script-unterminated-string.link b/test/link/script-unterminated-string.link new file mode 100644 index 00000000..ab5d7ee1 --- /dev/null +++ b/test/link/script-unterminated-string.link @@ -0,0 +1,2 @@ +rom0 + "ROM0 diff --git a/test/link/script-unterminated-string.out b/test/link/script-unterminated-string.out new file mode 100644 index 00000000..b84820ff --- /dev/null +++ b/test/link/script-unterminated-string.out @@ -0,0 +1,2 @@ +error: script-unterminated-string.link(2): Unterminated string +Linking failed with 1 error diff --git a/test/link/script.asm b/test/link/script.asm new file mode 100644 index 00000000..3c15d9a0 --- /dev/null +++ b/test/link/script.asm @@ -0,0 +1,5 @@ +; script*.link are tests for the linker script. +; So there isn't much to see here. + +SECTION "ROM0", ROM0 +SECTION "ROM1", ROMX,BANK[1]