Global Variables
test-compiler-pattern

The real test -- the self-hosted compiler pattern. Multiple globals, multiple functions accessing them:

    check_both(
        \\var src_pos: i64 = 0;
        \\var out_pos: i64 = 0;
        \\fn cur() i64 {
        \\    return load8(src_pos);
        \\}
        \\fn emit_byte(b: i64) i64 {
        \\    store8(50000 + out_pos, b);
        \\    out_pos = out_pos + 1;
        \\    return 0;
        \\}
        \\fn skip() i64 {
        \\    while (cur() == 32) {
        \\        src_pos = src_pos + 1;
        \\    }
        \\    return 0;
        \\}
        \\store8(0, 32);
        \\store8(1, 32);
        \\store8(2, 55);
        \\skip();
        \\emit_byte(cur());
        \\out_pos
    , 1);

This simulates the self-hosted compiler: source bytes at address 0 (two spaces then '7'), skip() advances src_pos past the spaces, cur() reads the '7' (55), emit_byte writes it to the output buffer. All functions share src_pos and out_pos through global variables.

If this passes in both engines: the foundational mechanism of the self-hosted compiler -- shared global state across scanner and emitter functions -- works correctly.