Repository navigation
docs, test: review follow-ups to #1076 and #1077 - #1091
Conversation
…go env -w lg builds the tinygo arm's GOFLAGS from the environment variable and sets it, which takes precedence over the go env file, so flags saved with go env -w drop out of that build. Follow-up to #1077. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Self-check. No actionable findings.
The documentation accurately describes tinyGoBuildEnv: for a caller-module build it constructs GOFLAGS from the supplied environment and appends -mod=readonly, so flags saved only in the Go env file are superseded. The added strict IR tests cover both multiplication operand orders, a ^long parameter hint, and a floating zero, including NaN and signed zero. Comparing printed values correctly distinguishes -0.0 from 0.0 and avoids NaN equality pitfalls. No production behavior changes.
Validation at 31a141d: the ir_mul_zero suite passed 3 tests / 6 assertions; TestTinyGoBuildEnv passed all four subtests; docs_frontmatter_hook.py --check passed for the changed guide. Independently checked the expected output vectors through ordinary bytecode: ["0.0" "NaN" "-0.0" "0"] for a ^long-hinted parameter multiplied by integer zero, and ["0.0" "NaN" "-0.0" "0.0"] for multiplication by floating zero. Existing CI is green.
nooga
left a comment
There was a problem hiding this comment.
Approving. The GOFLAGS note and the ^long/float-zero IR tests match bytecode behaviour.
Two small asks from the reviews of #1076 and #1077, one commit each.
#1077, docs. With
LETGO_USE_TINYGO=1and-w-module, lg builds the tinygo arm'sGOFLAGSfrom the environment variable and sets it. An environmentGOFLAGStakes precedence over the go env file, so flags saved withgo env -wdrop out of that build.docs/guide/custom-lg.mdnow says so and tells users to export them instead.#1076, tests.
test/ir_mul_zero_test.lgnow also checks(* x 0)on a^long-hinted param and(* x 0.0), both under*ir-compile*. A^longhint does not makexan Int: a double passed to it still comes back a double, which is why #1076 dropped the fold instead of guarding it on the type. The expected values match what bytecode returns for the same calls.Verification
make test LG_TEST=ir_mul_zeropasses.🤖 Generated with Claude Code