mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
RGBLINK lists local symbols when encountering an unknown symbol reference (#1496)
This commit is contained in:
2
test/link/symbols/unknown/a.asm
Normal file
2
test/link/symbols/unknown/a.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
section "a", rom0
|
||||
ld hl, Label
|
||||
2
test/link/symbols/unknown/b.asm
Normal file
2
test/link/symbols/unknown/b.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
section "b", rom0
|
||||
Label:
|
||||
1
test/link/symbols/unknown/c.asm
Normal file
1
test/link/symbols/unknown/c.asm
Normal file
@@ -0,0 +1 @@
|
||||
def Label equ 42
|
||||
1
test/link/symbols/unknown/d.asm
Normal file
1
test/link/symbols/unknown/d.asm
Normal file
@@ -0,0 +1 @@
|
||||
def Label = 123
|
||||
2
test/link/symbols/unknown/e.asm
Normal file
2
test/link/symbols/unknown/e.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
section "e", wram0
|
||||
Label:
|
||||
6
test/link/symbols/unknown/out.err
Normal file
6
test/link/symbols/unknown/out.err
Normal file
@@ -0,0 +1,6 @@
|
||||
error: symbols/unknown/a.asm(2): Unknown symbol "Label"
|
||||
A label with that name is defined but not exported at symbols/unknown/b.asm(2)
|
||||
A constant with that name is defined but not exported at symbols/unknown/c.asm(1)
|
||||
A constant with that name is defined but not exported at symbols/unknown/d.asm(1)
|
||||
...and 1 more symbol with that name is defined but not exported
|
||||
Linking failed with 1 error
|
||||
@@ -8,10 +8,11 @@ gbtemp="$(mktemp)"
|
||||
gbtemp2="$(mktemp)"
|
||||
outtemp="$(mktemp)"
|
||||
outtemp2="$(mktemp)"
|
||||
outtemp3="$(mktemp)"
|
||||
|
||||
# Immediate expansion is the desired behavior.
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -f ${otemp@Q} ${gbtemp@Q} ${gbtemp2@Q} ${outtemp@Q} ${outtemp2@Q}" EXIT
|
||||
trap "rm -f ${otemp@Q} ${gbtemp@Q} ${gbtemp2@Q} ${outtemp@Q} ${outtemp2@Q} ${outtemp3@Q}" EXIT
|
||||
|
||||
tests=0
|
||||
failed=0
|
||||
@@ -316,7 +317,7 @@ for i in section-union/*.asm; do
|
||||
evaluateTest
|
||||
done
|
||||
|
||||
test="symbols"
|
||||
test="symbols/good"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" "$test"/a.asm
|
||||
"$RGBASM" -o "$gbtemp2" "$test"/b.asm
|
||||
@@ -327,6 +328,18 @@ tryDiff "$test"/ref.out.sym "$outtemp2"
|
||||
tryCmpRom "$test"/ref.out.bin
|
||||
evaluateTest
|
||||
|
||||
test="symbols/unknown"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" "$test"/a.asm
|
||||
"$RGBASM" -o "$gbtemp" "$test"/b.asm
|
||||
"$RGBASM" -o "$gbtemp2" "$test"/c.asm
|
||||
"$RGBASM" -o "$outtemp" "$test"/d.asm
|
||||
"$RGBASM" -o "$outtemp2" "$test"/e.asm
|
||||
continueTest
|
||||
rgblinkQuiet "$otemp" "$gbtemp" "$gbtemp2" "$outtemp" "$outtemp2" 2>"$outtemp3"
|
||||
tryDiff "$test"/out.err "$outtemp3"
|
||||
evaluateTest
|
||||
|
||||
if [[ "$failed" -eq 0 ]]; then
|
||||
echo "${bold}${green}All ${tests} tests passed!${rescolors}${resbold}"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user