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:
22
examples/ffi-jni-call-05-jlong-return.sx
Normal file
22
examples/ffi-jni-call-05-jlong-return.sx
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user