Test-add for the jboolean return. JNI `jboolean` is a single byte (0 or 1); sx's `bool` lowers to LLVM `i1` with byte-coercion at the ABI boundary. CallBooleanMethod is at vtable slot 37. IR snapshot captures today's `ret i1 undef`. Next commit adds the `.bool => Jni.CallBooleanMethod` arm.
22 lines
607 B
Plaintext
22 lines
607 B
Plaintext
// Phase 1 step 1.21 (PLAN-FFI.md): `#jni_call(bool)` (jboolean
|
|
// return). JNI's `jboolean` is a single-byte unsigned integer (0 or
|
|
// 1) on every supported ABI; sx's `bool` lowers to LLVM `i1` but the
|
|
// arg/return coercion path widens it to the byte slot the JNI
|
|
// runtime expects. CallBooleanMethod lives at vtable slot 37.
|
|
|
|
#import "modules/std.sx";
|
|
|
|
g_should_call : bool = false;
|
|
|
|
read_bool :: (env: *void, target: *void) -> bool {
|
|
#jni_call(bool)(env, target, "isShown", "()Z");
|
|
}
|
|
|
|
main :: () -> s32 {
|
|
if g_should_call {
|
|
_ := read_bool(null, null);
|
|
}
|
|
print("ok\n");
|
|
0;
|
|
}
|