Files
sx/examples/concurrency/1802-concurrency-naked-asm-x86.sx
agra 66bdc70bf1 test: group examples into per-category folders
Move examples/*.sx and their expected/ snapshots into per-category
subfolders (examples/<category>/...). Folder = leading filename token,
with ffi-objc/ffi-jni kept whole; filenames are unchanged. The corpus
runner and LSP sweep now discover each category's expected/ dir, while
issues/ stays flat. Example 1058's repo-root-relative companion import
is made file-relative. Path strings embedded in 164 snapshots were
regenerated (path-only changes). Test-layout docs in CLAUDE.md updated.
2026-06-21 14:41:34 +03:00

20 lines
781 B
Plaintext

// Stream B1 (fibers) — x86_64 sibling of 1800: `abi(.naked)` emits a naked
// function whose body is raw x86_64 asm (returns 42 in eax, then its own `ret`).
//
// Lowered via LLVM's `naked` attribute (no prologue/epilogue/frame). x86_64-
// pinned via `.build`: ir-only on a non-x86 host — the `.ir` snapshot locks the
// `naked` attribute + the bare asm body (`movl $42, %eax` / `ret`) and the
// frame-pointer-free attribute set — and runs end-to-end (exit 42) on
// x86_64-linux. The IR text (the `naked` attribute, the `call void asm`) is
// target-independent; only the asm string differs from the aarch64 1800.
answer :: () -> i64 abi(.naked) {
asm volatile {
#string A
movl $42, %eax
ret
A
};
}
main :: () -> i64 { return answer(); }