Skip to content

check-x86-run.sh: expectations after #412 and #497 - #527

Merged
ASDAlexander77 merged 1 commit into
mainfrom
fix-check-x86-run-stale-expectations
Oct 6, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
fix-check-x86-run-stale-expectations

Conversation

@ASDAlexander77

@ASDAlexander77 ASDAlexander77 commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Two failures in the hand-run tslang/test/check-x86-run.sh were stale expectations, not compiler bugs.

x86 IR -mm=none: frame allocator is aligned_alloc(i32, i32)

Since #412, ProcessHeapPass renames aligned_alloc on Windows, under every memory model but gc, to the process-heap allocator __tslang_heap_aligned_alloc. This is intentional: modules share one heap because coroutine frames are freed across modules. AsyncTargetWidthPass runs first, so the renamed declaration keeps the target's 32-bit size_t:

declare ptr @__tslang_heap_aligned_alloc(i32, i32) local_unnamed_addr #2

The check now requires that name with both parameters i32. The pattern still rejects (i64, i64) and (i32, i64).

await_order -mm=gc: expected output

The expected start / after await / in g was recorded when an await of a void async function did not wait. Since #497, main blocks in mlirAsyncRuntimeAwaitToken until the worker emplaces g()'s token, and the worker does that only after puts("in g"). So the order is now deterministic: start / in g / after await. It printed that in 200/200 x86 runs and 100/100 x64 runs. The expected text and the comment in await_order.ts are updated.

await_order under rc, none and own

Since #419, an async program links without the collector. The exact-output await_order case therefore now runs under -mm=rc, -mm=none and -mm=own as well as gc: 100/100 x86 runs each printed start / in g / after await. The comments saying rc/none fail to link are updated.

Test plan

  • bash tslang/test/check-x86-run.sh __build/tslang/windows-msbuild-2026-release/bin/tslang.exe: all cases ok, including await_order under gc, rc, none and own. The default-library section was SKIPPED because no x86 default library was present at the worktree path.

🤖 Generated with Claude Code

The -mm=none frame allocator check looked for aligned_alloc(i32, i32).
Since #412 ProcessHeapPass renames it on Windows, under every model but
gc, to the process-heap allocator __tslang_heap_aligned_alloc, which
keeps the 32-bit size_t signature AsyncTargetWidthPass gave it. The
check now requires that name with both parameters i32.

await_order expected "after await" before "in g", recorded when an
await of a void async function did not wait. Since #497 main waits on
g()'s token, so "in g" always prints first (300/300 runs, x86 and x64).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 624c8b2 into main Oct 6, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the fix-check-x86-run-stale-expectations branch October 6, 2026 17:54
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