Prevent rgblink -Wno-* disabled warnings from printing a location trace anyway

Fixes #2005
This commit is contained in:
Rangi
2026-07-04 23:02:16 -04:00
committed by Rangi
parent 799c55b4dd
commit de36a11be7
7 changed files with 24 additions and 5 deletions
+4
View File
@@ -142,6 +142,10 @@ linked in various ways depending on the test.
These simply check that RGBLINK's output matches some expected output. These simply check that RGBLINK's output matches some expected output.
If a `.flags` file exists, its first line contains flags to pass to RGBLINK.
(There may be more lines, which will be ignored; they can serve as comments to
explain what the test is about.)
A `.out` file **must** exist, and RGBLINK's total output must match that file's A `.out` file **must** exist, and RGBLINK's total output must match that file's
contents. contents.
+3 -1
View File
@@ -212,16 +212,18 @@ void scriptWarning(WarningID id, char const *fmt, ...) {
case WarningBehavior::ENABLED: case WarningBehavior::ENABLED:
printDiag(nullptr, 0, fmt, args, "warning", STYLE_YELLOW, "[-W%s]", flag); printDiag(nullptr, 0, fmt, args, "warning", STYLE_YELLOW, "[-W%s]", flag);
lexer_TraceCurrent();
break; break;
case WarningBehavior::ERROR: case WarningBehavior::ERROR:
printDiag(nullptr, 0, fmt, args, "error", STYLE_RED, "[-Werror=%s]", flag); printDiag(nullptr, 0, fmt, args, "error", STYLE_RED, "[-Werror=%s]", flag);
lexer_TraceCurrent();
warnings.incrementErrors(); warnings.incrementErrors();
break; break;
} }
va_end(args); va_end(args);
lexer_TraceCurrent();
} }
+2
View File
@@ -0,0 +1,2 @@
section "test", romx
label: dw label
+1
View File
@@ -0,0 +1 @@
-Wno-large-constant
+2
View File
@@ -0,0 +1,2 @@
ROMX $ffff_ffff_ffff_ffff
"test"
+3
View File
@@ -0,0 +1,3 @@
error: ROMX bank 0 does not exist (the minimum is 1)
at no-large-constant.link(1)
Linking failed with 1 error
+9 -4
View File
@@ -93,19 +93,24 @@ for i in *.asm; do
startTest startTest
"$RGBASM" -o "$otemp" "${test}.asm" "$RGBASM" -o "$otemp" "${test}.asm"
RGBLINKFLAGS=""
if [ -f "${test}.flags" ]; then
RGBLINKFLAGS="$RGBLINKFLAGS @${test}.flags"
fi
# Some tests have variants depending on flags # Some tests have variants depending on flags
ran_flag=false ran_flag=false
for flag in '-d' '-t' '-w'; do for flag in '-d' '-t' '-w'; do
if [ -f "${test}-no${flag}.out" ]; then if [ -f "${test}-no${flag}.out" ]; then
continueTest "-no${flag}" continueTest "-no${flag}"
rgblinkQuiet -o "$gbtemp" "$otemp" 2>"$outtemp" rgblinkQuiet $RGBLINKFLAGS -o "$gbtemp" "$otemp" 2>"$outtemp"
tryDiff "${test}-no${flag}.out" "$outtemp" tryDiff "${test}-no${flag}.out" "$outtemp"
evaluateTest evaluateTest
ran_flag=true ran_flag=true
fi fi
if [ -f "${test}${flag}.out" ]; then if [ -f "${test}${flag}.out" ]; then
continueTest "$flag" continueTest "$flag"
rgblinkQuiet ${flag} -o "$gbtemp" "$otemp" 2>"$outtemp" rgblinkQuiet $RGBLINKFLAGS ${flag} -o "$gbtemp" "$otemp" 2>"$outtemp"
tryDiff "${test}${flag}.out" "$outtemp" tryDiff "${test}${flag}.out" "$outtemp"
evaluateTest evaluateTest
ran_flag=true ran_flag=true
@@ -120,7 +125,7 @@ for i in *.asm; do
[[ -e "$script" ]] || break # If the glob doesn't match, it just... doesn't expand! [[ -e "$script" ]] || break # If the glob doesn't match, it just... doesn't expand!
continueTest "${script#${test}}" continueTest "${script#${test}}"
rgblinkQuiet -l "$script" -o "$gbtemp" "$otemp" 2>"$outtemp" rgblinkQuiet $RGBLINKFLAGS -l "$script" -o "$gbtemp" "$otemp" 2>"$outtemp"
tryDiff "${script%.link}.out" "$outtemp" tryDiff "${script%.link}.out" "$outtemp"
evaluateTest evaluateTest
ran_flag=true ran_flag=true
@@ -131,7 +136,7 @@ for i in *.asm; do
# The rest of the tests just links a file, and maybe checks the binary # The rest of the tests just links a file, and maybe checks the binary
continueTest continueTest
rgblinkQuiet -o "$gbtemp" "$otemp" 2>"$outtemp" rgblinkQuiet $RGBLINKFLAGS -o "$gbtemp" "$otemp" 2>"$outtemp"
tryDiff "${test}.out" "$outtemp" tryDiff "${test}.out" "$outtemp"
bin=${test}.out.bin bin=${test}.out.bin
if [ -f "$bin" ]; then if [ -f "$bin" ]; then