ffi 1.19: lock in undef shape for #jni_call(s64)

Test-add for the jlong return-type variant — same shape as 1.18's
jint test but exercising `#jni_call(s64)(env, target,
"currentTimeMillis", "()J")`. Today the non-void switch falls
through to `LLVMGetUndef`; the IR snapshot captures the placeholder.

The next commit adds the `.s64 => Jni.CallLongMethod` arm. The
snapshot will update to show the full dispatch through vtable slot
52, reusing the 1.17 slot interning machinery.
This commit is contained in:
agra
2026-05-19 22:30:05 +03:00
parent c1877fc00e
commit da5b6351e2
4 changed files with 293 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// Phase 1 step 1.19 (PLAN-FFI.md): `#jni_call(s64)` (jlong return).
// Today the non-void switch falls through to `LLVMGetUndef`; the IR
// snapshot captures the placeholder. The make-green commit adds the
// `.s64 => 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) -> s64 {
#jni_call(s64)(env, target, "currentTimeMillis", "()J");
}
main :: () -> s32 {
if g_should_call {
_ := read_long(null, null);
}
print("ok\n");
0;
}