From 9ec72b7895ef3979e0f881319304a2823ec195fa Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Thu, 4 Jun 2026 06:51:35 +0900 Subject: [PATCH] test/804: u16 row exercises the MOVW copy-tail arm (#35 review) esz 1/4/8/24/56 left the esz=2 MOVW tail the only emitted-but- unexercised copy arm in both stages' delete lowering. 41 -> 44 fixtures. --- test/wcc/804_delete_elem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/wcc/804_delete_elem.c b/test/wcc/804_delete_elem.c index 5cf87432..b24efea1 100644 --- a/test/wcc/804_delete_elem.c +++ b/test/wcc/804_delete_elem.c @@ -27,6 +27,8 @@ * i64_last | [7,11,13], delete(xs[2]) (no copy, | 38 * | loop body never runs) | * i32_narrow | []i32 esz=4 — the MOVL copy tail | 229 + * u16_narrow | []u16 esz=2 — the MOVW copy tail (the | 26 + * | last otherwise-unexercised tail arm) | * u8_narrow | []u8 esz=1 — the MOVB copy tail | 28 * cap_unchanged | manual {ptr,len=3,cap=8} header over a | 91 * | stack backing; delete middle; cap must | @@ -137,6 +139,18 @@ static const struct row rows[] = { "};\n", 229, NULL }, + { "u16_narrow", + "package main;\n" + "export fn main() i32 = {\n" + "\tlet xs: []u16 = [];\n" + "\tappend(xs, 4u16);\n" + "\tappend(xs, 9u16);\n" + "\tappend(xs, 2u16);\n" + "\tdelete(xs[1]);\n" + "\treturn (xs[0] + xs[1]): i32 + len(xs)*10;\n" + "};\n", + 26, NULL }, + { "u8_narrow", "package main;\n" "export fn main() i32 = {\n"