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.
23 lines
643 B
Plaintext
23 lines
643 B
Plaintext
// 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;
|
|
}
|