test: 955 add negative-f64-lit compare rows (#103 FACE X)

-8f64 is N_UN(TK_MINUS) wrapping a float-typed N_INTLIT; the wwstage
exprfloatkind must recurse through the unary into the N_INTLIT-float
arm. Two rows: a true-case catcher (g(-8.0) == -8f64 -> 1; pre-fix the
literal never reaches X0 so the compare is always false and g(-8.0)
wrongly returns 0, plus a cs!=ww .s divergence) and a false-case
control (g(8.0) -> 0). Both pass byte-identically on the fix.
This commit is contained in:
2026-05-25 15:38:47 +09:00
parent 0388cb7a26
commit 4c4006d854

View File

@@ -63,6 +63,21 @@ static const struct row rows[] = {
{ "x_arith",
"package main;\n"
"export fn main() i32 = { return (8f64 * 10.0): i32; };\n", 80 },
/* FACE X negative-lit: `-8f64` is N_UN(TK_MINUS) wrapping a float-
* typed N_INTLIT, so the wwstage exprfloatkind must recurse through
* the unary into the new N_INTLIT-float arm. g(-8.0) == -8f64 must be
* true -> 1; on the bug the literal never reaches X0, the compare is
* always false, and g(-8.0) wrongly returns 0. */
{ "x_neg_cmp_true",
"package main;\n"
"fn g(n: f64) i32 = { if (n == -8f64) { return 1; }; return 0; };\n"
"export fn main() i32 = { return g(-8.0); };\n", 1 },
/* FACE X negative-lit control: g(8.0) == -8f64 must stay false -> 0.
* Guards the negative-literal path against over-reach. */
{ "x_neg_cmp_false",
"package main;\n"
"fn g(n: f64) i32 = { if (n == -8f64) { return 1; }; return 0; };\n"
"export fn main() i32 = { return g(8.0); };\n", 0 },
/* FACE Z: tuple positional f64 field compare. r.0 == 0.0 with
* r = (8.0, 0) must be false -> 9. On the bug r.0 loads into AX
* (integer op), `== 0.0` reads stale X0 -> wrongly true -> 5. */