fix(test): expect_eq and expect_near compare floats as floats

On a float or double they emitted an i32 compare and clang refused the
IR; they compare as the wider float kind now and a failure prints the
numbers with %g. Reseed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 05:06:15 +03:00
parent f5e7fe4245
commit 31d842fca4
8 changed files with 21598 additions and 20759 deletions

View file

@ -107,6 +107,7 @@ function emit_test_runner() -> void {
var i = 0
while i < len(g_tests) { emit_test_fn(g_tests[i], i); i += 1 }
if g_uses_expect { emith("@.fmt_expect = private unnamed_addr constant [22 x i8] c\"%s (got %d, want %d)\\0A\\00\"\n") }
if g_uses_expect_fp { emith("@.fmt_expect_fp = private unnamed_addr constant [22 x i8] c\"%s (got %g, want %g)\\0A\\00\"\n") }
ll_t = 0; ll_lbl = 0
emit("define i32 @main(i32 %argc, ptr %argv) {\nentry:\n")