Files
sx/examples/platform/1648-platform-asm-global.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

21 lines
689 B
Plaintext

// ASM stream Phase F — top-level (global) `asm { … }`: a template-only block at
// module scope, lowered to LLVM `module asm` (LLVMAppendModuleInlineAsm). It
// defines a symbol that a lib-less `extern` declaration calls into — the
// import direction reuses the existing C-FFI extern path, no new surface.
// Built+run via `aot` (a module-asm symbol lives in the final linked binary,
// not the JIT host); aarch64-macos-pinned, so ir-only on a non-matching host.
asm {
#string ASM
.global _my_add
_my_add:
add x0, x0, x1
ret
ASM,
};
my_add :: (a: i64, b: i64) -> i64 extern;
main :: () -> i64 {
return my_add(40, 2); // 42, computed by the global-asm routine
}