Files
sx/examples/platform/1650-platform-asm-rw-place.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

12 lines
530 B
Plaintext

// ASM stream Phase 2 — read-write (`+`) place output. The place is LOADED as a
// seed, the asm both reads and writes the operand register (tied input ↔ output),
// and the (modified) result is STORED back through the place. Increment-in-place:
// the register holds 41 on entry, the asm adds 1, 42 is written back to `x`.
// aarch64-pinned; ir-only elsewhere.
compute :: () -> i64 {
x : i64 = 41;
asm volatile { "add %[v], %[v], #1", [v] "+r" -> @x };
return x; // 42
}
main :: () -> i64 { return compute(); }