Skip to content

Fix puts/cf.assert signature conflict crashing JIT tests#184

Merged
ASDAlexander77 merged 5 commits into
mainfrom
fix-puts-cf-assert-conflict
Jul 5, 2026
Merged

Fix puts/cf.assert signature conflict crashing JIT tests#184
ASDAlexander77 merged 5 commits into
mainfrom
fix-puts-cf-assert-conflict

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Summary

  • MLIR's cf.assert-to-LLVM lowering reserves puts as void(ptr) when it needs to print an assertion failure message. Our own PrintOp lowering separately declared puts as i32(ptr) (matching libc), so whichever declaration was created first caused redefinition of reserved function 'puts' of different type, which left cf.assert unlegalized and crashed module verification for any test that both called print(...) and lowered a cf.assert.
  • Fix: declare puts as void(ptr) in PrintOpLowering (lib/TypeScript/LowerToLLVM.cpp) since the return value was never captured anyway.
  • Re-enable test-jit-00-async-await and test-jit-00-for-await on Windows now that they pass; test-jit-00-for-await-yield stays disabled — it hits a separate, unrelated async-generator runtime hang.

Test plan

  • ctest -R ^test-jit-00-async-await$ — passes
  • ctest -R ^test-jit-00-for-await$ — passes
  • Full test-jit-00* suite (195 tests) — 194 pass, 1 pre-existing hang (for-await-yield, left disabled)

…fault-lib

MLIR's cf.assert-to-LLVM lowering reserves "puts" as void(ptr) when it
needs to print an assertion message. Our PrintOp lowering separately
declared "puts" as i32(ptr) (matching libc), so whichever declaration
landed first caused "redefinition of reserved function 'puts' of
different type" and left 'cf.assert' unlegalized, crashing any JIT/AOT
test that both printed and hit a lowered cf.assert. Declare it as
void(ptr) instead since the return value was never used.

Re-enables test-jit-00-async-await and test-jit-00-for-await on
Windows now that they pass; test-jit-00-for-await-yield stays disabled
since it hits a separate async-generator runtime hang.
@ASDAlexander77 ASDAlexander77 merged commit da50819 into main Jul 5, 2026
2 checks passed
@ASDAlexander77 ASDAlexander77 deleted the fix-puts-cf-assert-conflict branch July 5, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant