Files
ww/test/wcc/data/attest_nondrop.ww
Hojun-Cho 08a76cf4c8 wcc: drop @test fns from non-T builds, both stages (harec check.c:3941)
Splice @test N_FNDECLs out of the unit after the body-check passes,
mirroring harec's checked-but-not-emitted: a broken @test body still
errors loudly in non-T; @test-free units are emission-unchanged.
910/997 table rows pin keep/test x non-T/-T, head+consecutive unlink,
undef-body reject, and plain-calls-dropped loud link-fail. w6c+wwdump
combined.ww regen. (#6-team)
2026-06-10 22:20:15 +09:00

29 lines
847 B
Plaintext

// #6 fixture: non-(-T) @test drop, harec-fidelity (ref/harec/src/
// check.c:3941 — FN_TEST && !is_test is checked but not emitted). A
// normal fn must survive a non-test build; uncalled @test fns must NOT
// reach codegen. Under -T the synth entry calls the @test fns, so their
// TEXT defs reappear. No imports — compiles straight to asm in both
// modes for a TEXT-label grep (910/997 nondrop rows).
//
// Layout exercises the splice loop's unlink edges: a @test fn FIRST
// (prev==nil head-unlink), a surviving plain fn, then TWO consecutive
// @test fns (unlink-after-unlink). All three @test defs vanish non-T.
package data;
@test fn nondrop_test_a() void = {
let a: i32 = 1;
};
fn nondrop_keep() i32 = {
return 1;
};
@test fn nondrop_test_b() void = {
let a: i32 = 1;
};
@test fn nondrop_test_c() void = {
let a: i32 = 1;
};