Files
sx/examples/ffi-jni/1408-ffi-jni-call-09-static.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

25 lines
693 B
Plaintext

// Phase 1 step 1.23 (PLAN-FFI.md): `#jni_static_call` lowering.
// For static dispatch the `target` arg IS already a `jclass`, so the
// lowering skips `GetObjectClass` and uses `GetStaticMethodID` +
// `CallStatic<Type>Method` instead. Today `is_static = true` drops
// to `LLVMGetUndef`; the snapshot captures the placeholder. Next
// commit wires the static dispatch path.
#import "modules/std.sx";
g_should_call : bool = false;
call_static_max :: (env: *void, cls: *void) -> i32 {
#jni_env(env) {
#jni_static_call(i32)(cls, "max", "(II)I", 3, 7)
}
}
main :: () -> i32 {
if g_should_call {
_ := call_static_max(null, null);
}
print("ok\n");
0
}