ffi 1.20: lock in undef shape for #jni_call(f64)
Test-add for the jdouble return-type variant — `#jni_call(f64)(env, target, "getValue", "()D")`. First non-integer return type for JNI. IR snapshot captures today's `ret double undef` placeholder. The next commit adds the `.f64 => Jni.CallDoubleMethod` arm.
This commit is contained in:
19
examples/ffi-jni-call-06-jdouble-return.sx
Normal file
19
examples/ffi-jni-call-06-jdouble-return.sx
Normal file
@@ -0,0 +1,19 @@
|
||||
// Phase 1 step 1.20 (PLAN-FFI.md): `#jni_call(f64)` (jdouble return).
|
||||
// First non-integer return type for JNI — exercises the LLVM
|
||||
// `double` ret path through CallDoubleMethod (vtable slot 58).
|
||||
|
||||
#import "modules/std.sx";
|
||||
|
||||
g_should_call : bool = false;
|
||||
|
||||
read_double :: (env: *void, target: *void) -> f64 {
|
||||
#jni_call(f64)(env, target, "getValue", "()D");
|
||||
}
|
||||
|
||||
main :: () -> s32 {
|
||||
if g_should_call {
|
||||
_ := read_double(null, null);
|
||||
}
|
||||
print("ok\n");
|
||||
0;
|
||||
}
|
||||
Reference in New Issue
Block a user