// floatarr_test — float array-element load/store, migrated from // test/wcc/946_floatarr_run.c (#5-C4, #119 + #122). A float ARRAY ELEMENT load // must land in X0 (MOVSS/MOVSD), not the integer register file (MOVQ -> AX); the // element STORE (array-lit init, arr[i]=, and [v...] repeat-fill) must route FROM // X0 via MOVSS/MOVSD, not write the raw double low-bits via MOVL AX. Pre-fix the // f64 elements loaded into AX while the consumer's ADDSD read a stale X0, and f32 // slots read back garbage. The N_INDEX result type is checker-stamped (dodging // the #121 unstamped trap). Both stages byte-identical; T1 run + T2 byte-id. package floatarr_test; @test fn f64_arith() void = { let a: [3]f64 = [1.5, 2.5, 9.0]; assert(a[0] + a[1] == 4.0); }; @test fn f64_trunc() void = { let a: [3]f64 = [1.5, 2.5, 9.0]; assert(a[0]: i32 == 1); }; @test fn f64_elem2() void = { let a: [3]f64 = [1.5, 2.5, 9.0]; assert(a[2] == 9.0); }; @test fn f32_arith() void = { let b: [2]f32 = [1.5f32, 2.5f32]; assert((b[0] + b[1]): f64 == 4.0); }; // arr[i]= index store (#122) into a [0.0f32,0.0f32]-init array. @test fn f32_index_store() void = { let b: [2]f32 = [0.0f32, 0.0f32]; b[0] = 1.5f32; b[1] = 2.5f32; assert((b[0] + b[1]): f64 == 4.0); }; // [v...] repeat-fill init store (#122): 1.5 * 3 == 4.5 (exact in IEEE). @test fn f32_repeat_fill() void = { let c: [3]f32 = [1.5f32...]; assert((c[0] + c[1] + c[2]): f64 == 4.5); };