// 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); };