fix: refactor if-statement codegen and enhance test runner #257
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.
This PR addresses critical issues in the code generation logic for
ifstatements and significantly upgrades the integration testing infrastructure. The changes ensure that control flow is generated correctly for complex conditional chains and that the automated test suite can handle networking and interactive scenarios without manual intervention.Key Changes
1. Robust
IfStatement Codegeni1(boolean) types. This allows the Wave compiler to support C-style truthiness (e.g.,if (pointer)) while satisfying LLVM's strict branching requirements.else ifandelseBasicBlock generation to ensure correct linear ordering in the IR.mergeblock, leading to "terminator found in the middle of a block" errors.2. Test Runner (
run_tests.py) Enhancementstest61.wave. This allows the network listener test to receive data and exit successfully instead of hanging until a timeout.SKIPstatus for tests that require manual user input (e.g.,test22.waveforinput()verification). This prevents the CI/CD pipeline from reporting false-positive failures for tests that cannot be fully automated.3. Maintenance
.github/FUNDING.yml.Examples of Improved Codegen Behavior
Benefits
ifcondition behavior closer to industry standards (C/C++, Rust).