Files
ww/test/lang/f32stamp_test.ww
Hojun-Cho 60dec4a6bf test: migrate Fam11 float value tests to @test, keep ABI-conformance pins (#5-C4)
fold-2 chunk C4 (drew's Fam8-13 plan): 13 float value-row C drivers re-homed.
11 migrate to test/lang/*_test.ww @test row-tables (exact IEEE-bit asserts);
1 float-overflow reject row -> a runww //ww:error carrier. 956_tuprecv_f64
slims to a w6c_ww asserttyped pin (20 value rows -> @test; the stamp dimension
can't be a value/byte-id @test) -- mutation-proven non-vacuous (break #121
stamp -> RED 6/6 -> restore -> GREEN) + an in-test vacuity self-check.
946_structparam/structret stay whole: their SSE register-class .s-grep (SysV
ABI conformance, #165/#171a) is the genuine defect-guard, not @test-expressible.
Float was the predicted SSE-cursor byte-id hotspot -- zero fresh cs!=ww
surfaced; 951_f64cgen (cstage-only before) byte-ids clean. LANGBYTEID floor
82->93; test count 384->374 (10 deleted drivers; 956 + the 2 946 kept).
2026-06-24 03:25:47 +09:00

41 lines
1.2 KiB
Plaintext

// f32stamp_test — un-suffixed f32-context literal checker-stamp, migrated from
// test/wcc/965_f32stamp_run.c (#5-C4, #104 fold-2). An UN-suffixed float literal
// in an f32 context (`let x: f32 = 1.0`, `return 1.0` from an f32 fn) must be
// stamped f32 by the checker so fold-1's cgen narrow fires; without the stamp it
// stays ty_untyped_float, materialises as a 64-bit double, and the f32 consumer
// reads the low 4 bytes (0.0f for clean values). SCOPE (#104 fold-2): the stamp
// fires at let-init and return ONLY — binop/unary/assign/call-arg/struct-field
// are deferred to #120, so this pins bare let-init / return literals exclusively.
// Both stages byte-identical; T1 cstage run is the live net, T2 byte-id rides.
package f32stamp_test;
fn g() f32 = { return 2.0; };
fn h() f32 = { return 4.0; };
@test fn let_one() void = {
let x: f32 = 1.0;
assert(x: f64 == 1.0);
};
@test fn let_decimal() void = {
let y: f32 = 8.0;
assert(y: i32 == 8);
};
@test fn let_frac() void = {
let p: f32 = 0.5;
assert(p: f64 == 0.5);
};
@test fn return_bare() void = {
assert(g(): i32 == 2);
};
@test fn return_then_let() void = {
let r: f32 = h();
assert(r: f64 == 4.0);
assert(r: i32 == 4);
};