// len_str_global_test — `len(str-global)` must load the .len word, migrated // from test/wcc/797_len_strglobal_run.c (#231). BOTH stages were wrong, // DIFFERENTLY (byte-id was blind because they also diverged, but no bootstrap // source exercised the shape): cstage's len() arm took the BP-relative slot // load for a top-level global (localfind returns 0 → bogus `MOVQ 8(BP),AX`); // wwstage's arm only handled locals, so a global fell to cgexpr and left // AX=.ptr. The fix emits the global .len load `LEAQ name(SB),CX; MOVQ 8(CX),AX` // in both, routed through the post-#1 value mangle. The local-str case was // correct in both (control). package len_str_global_test; let g: str = "hello"; @test fn str_global_len() void = { assert(len(g): i32 == 5); }; @test fn str_local_len() void = { let g: str = "hello"; assert(len(g): i32 == 5); };