Files
sx/examples/ffi-objc/1302-ffi-objc-block-noop.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

18 lines
613 B
Plaintext

// `xx <closure> : Block` builds an Apple-ABI block whose invoke
// trampoline delegates to the sx closure. Verifies end-to-end:
// stdlib Block layout, _NSConcreteStackBlock extern, per-signature
// invoke trampoline, Into(Block) for Closure() -> void. Runs on
// macOS — invokes the block's invoke fn directly via a typed fn
// pointer instead of going through the Obj-C runtime.
#import "modules/std.sx";
#import "modules/ffi/objc_block.sx";
main :: () -> i32 {
cl := () => { print("noop block ran\n"); };
b : Block = xx cl;
invoke_fn : (*Block) -> void abi(.c) = xx b.invoke;
invoke_fn(@b);
0
}