Files
sx/examples/ffi-jni/1404-ffi-jni-call-05-jlong-return.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

25 lines
666 B
Plaintext

// Phase 1 step 1.19 (PLAN-FFI.md): `#jni_call(i64)` (jlong return).
// Today the non-void switch falls through to `LLVMGetUndef`; the IR
// snapshot captures the placeholder. The make-green commit adds the
// `.i64 => Jni.CallLongMethod` arm and the snapshot updates to show
// the full dispatch through vtable slot 52, reusing the 1.17 slot
// interning.
#import "modules/std.sx";
g_should_call : bool = false;
read_long :: (env: *void, target: *void) -> i64 {
#jni_env(env) {
#jni_call(i64)(target, "currentTimeMillis", "()J")
}
}
main :: () -> i32 {
if g_should_call {
_ := read_long(null, null);
}
print("ok\n");
0
}