mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Add 0/1/2 warning levels to rgblink -Wtruncation (#1816)
This commit is contained in:
@@ -439,6 +439,22 @@ rgblinkQuiet "$otemp" "$gbtemp" "$gbtemp2" "$outtemp" "$outtemp2" 2>"$outtemp3"
|
||||
tryDiff "$test"/out.err "$outtemp3"
|
||||
evaluateTest
|
||||
|
||||
test="truncation/level1"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" "$test"/a.asm
|
||||
continueTest
|
||||
rgblinkQuiet -Wtruncation=1 -o "$gbtemp" "$otemp" 2>"$outtemp"
|
||||
tryDiff "$test"/out.err "$outtemp"
|
||||
evaluateTest
|
||||
|
||||
test="truncation/level2"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" "$test"/a.asm
|
||||
continueTest
|
||||
rgblinkQuiet -Wtruncation=2 -o "$gbtemp" "$otemp" 2>"$outtemp"
|
||||
tryDiff "$test"/out.err "$outtemp"
|
||||
evaluateTest
|
||||
|
||||
if [[ "$failed" -eq 0 ]]; then
|
||||
echo "${bold}${green}All ${tests} tests passed!${rescolors}${resbold}"
|
||||
else
|
||||
|
||||
6
test/link/truncation/level1/a.asm
Normal file
6
test/link/truncation/level1/a.asm
Normal file
@@ -0,0 +1,6 @@
|
||||
section "rom", rom0
|
||||
ld bc, -wLabel
|
||||
ld de, -(wLabel * 2)
|
||||
|
||||
section "ram", wram0
|
||||
wLabel::
|
||||
2
test/link/truncation/level1/out.err
Normal file
2
test/link/truncation/level1/out.err
Normal file
@@ -0,0 +1,2 @@
|
||||
warning: Value $fffe8000 (may be negative?) is not 16-bit [-Wtruncation]
|
||||
at truncation/level1/a.asm(3)
|
||||
6
test/link/truncation/level2/a.asm
Normal file
6
test/link/truncation/level2/a.asm
Normal file
@@ -0,0 +1,6 @@
|
||||
section "rom", rom0
|
||||
ld bc, -wLabel
|
||||
ld de, -(wLabel * 2)
|
||||
|
||||
section "ram", wram0
|
||||
wLabel::
|
||||
4
test/link/truncation/level2/out.err
Normal file
4
test/link/truncation/level2/out.err
Normal file
@@ -0,0 +1,4 @@
|
||||
warning: Value $fffe8000 (may be negative?) is not 16-bit [-Wtruncation]
|
||||
at truncation/level2/a.asm(3)
|
||||
warning: Value $ffff4000 (may be negative?) is not 16-bit [-Wtruncation]
|
||||
at truncation/level2/a.asm(2)
|
||||
Reference in New Issue
Block a user