Fix puts/cf.assert signature conflict crashing JIT tests#184
Merged
Conversation
…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.
…ing of stdio on Windows
…andle heap allocation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cf.assert-to-LLVM lowering reservesputsasvoid(ptr)when it needs to print an assertion failure message. Our ownPrintOplowering separately declaredputsasi32(ptr)(matching libc), so whichever declaration was created first causedredefinition of reserved function 'puts' of different type, which leftcf.assertunlegalized and crashed module verification for any test that both calledprint(...)and lowered acf.assert.putsasvoid(ptr)inPrintOpLowering(lib/TypeScript/LowerToLLVM.cpp) since the return value was never captured anyway.test-jit-00-async-awaitandtest-jit-00-for-awaiton Windows now that they pass;test-jit-00-for-await-yieldstays disabled — it hits a separate, unrelated async-generator runtime hang.Test plan
ctest -R ^test-jit-00-async-await$— passesctest -R ^test-jit-00-for-await$— passestest-jit-00*suite (195 tests) — 194 pass, 1 pre-existing hang (for-await-yield, left disabled)