Files
sx/examples/ffi-jni/1405-ffi-jni-call-06-jdouble-return.sx
agra 66bdc70bf1 test: group examples into per-category folders
Move examples/*.sx and their expected/ snapshots into per-category
subfolders (examples/<category>/...). Folder = leading filename token,
with ffi-objc/ffi-jni kept whole; filenames are unchanged. The corpus
runner and LSP sweep now discover each category's expected/ dir, while
issues/ stays flat. Example 1058's repo-root-relative companion import
is made file-relative. Path strings embedded in 164 snapshots were
regenerated (path-only changes). Test-layout docs in CLAUDE.md updated.
2026-06-21 14:41:34 +03:00

22 lines
503 B
Plaintext

// 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_env(env) {
#jni_call(f64)(target, "getValue", "()D")
}
}
main :: () -> i32 {
if g_should_call {
_ := read_double(null, null);
}
print("ok\n");
0
}