diff --git a/test/wcc/955_f64xmm_run.c b/test/wcc/955_f64xmm_run.c index 0731a627..d3707012 100644 --- a/test/wcc/955_f64xmm_run.c +++ b/test/wcc/955_f64xmm_run.c @@ -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. */