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).
41 lines
1.7 KiB
Plaintext
41 lines
1.7 KiB
Plaintext
// globfloatstructarg_test — module-global float-bearing struct passed by value,
|
|
// migrated from test/wcc/989_globfloatstructarg_run.c (#5-C4, #31, F8 EXCEPTION).
|
|
// cgcall's per-arg drain decides the SysV eightbyte class via structfloatclass
|
|
// read from the local slot's tnode ONLY; a module-global struct arg (lc==nil)
|
|
// kept stfc=0, so the float eightbytes drained as integers (POPQ into DI/SI) and
|
|
// X0 was never loaded — the callee read its f64 fields from the wrong registers.
|
|
// cstage classifies off the operand TYPE and ran correct — the cat-A divergence.
|
|
// The fix keys structfloatclass off the global's declared tnode (align ww UP);
|
|
// .s is byte-identical. The C driver ran both stages (rule-10 agree+hit); here
|
|
// T1 cstage run + T2 byte-id. Each row had its own `pair`/`gp`; renamed per-row
|
|
// for single-file coexistence (the global-vs-local drain class is unchanged).
|
|
|
|
package globfloatstructarg_test;
|
|
|
|
type pair_ff = struct { f: f64, i: i64 };
|
|
let gp_ff: pair_ff = pair_ff { f = 1.5, i = 9 };
|
|
fn take_ff(p: pair_ff) int = { if (p.f == 1.5 && p.i == 9) { return 0; }; return 2; };
|
|
|
|
type pair_if = struct { i: i64, f: f64 };
|
|
let gp_if: pair_if = pair_if { i = 9, f = 2.5 };
|
|
fn take_if(p: pair_if) int = { if (p.i == 9 && p.f == 2.5) { return 0; }; return 2; };
|
|
|
|
type pair_bb = struct { a: f64, b: f64 };
|
|
let gp_bb: pair_bb = pair_bb { a = 1.5, b = 2.5 };
|
|
fn take_bb(p: pair_bb) int = { if (p.a == 1.5 && p.b == 2.5) { return 0; }; return 2; };
|
|
|
|
// float_first: f->X0 (#31).
|
|
@test fn float_first() void = {
|
|
assert(take_ff(gp_ff) == 0);
|
|
};
|
|
|
|
// int_first: int eb->GP, f->X0.
|
|
@test fn int_first() void = {
|
|
assert(take_if(gp_if) == 0);
|
|
};
|
|
|
|
// both_float: two SSE eightbytes.
|
|
@test fn both_float() void = {
|
|
assert(take_bb(gp_bb) == 0);
|
|
};
|