From e5df0a9d8412c6c273a54e0c248483687f2248a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Balv=C3=ADn?= Date: Wed, 7 Oct 2026 21:52:27 +0200 Subject: [PATCH] fix(asm): adapt the flag list integration test to the paired oracle Assisted-by: GLM 5.3 Flash --- asm/flaglist_integration_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/asm/flaglist_integration_test.go b/asm/flaglist_integration_test.go index 6b32451..edd7f70 100644 --- a/asm/flaglist_integration_test.go +++ b/asm/flaglist_integration_test.go @@ -103,13 +103,16 @@ func TestFlagListByteParity(t *testing.T) { if oout, err := cmd.CombinedOutput(); err != nil { t.Fatalf("go tool asm: %v\n%s", err, oout) } - goCode, ok := oracleFuncText(t, mustRead(t, objPath))["f"] + blocks, ok := oracleFuncText(t, mustRead(t, objPath))["f"] if !ok { t.Fatal("the oracle output carries no f") } + if len(blocks) != 1 { + t.Fatalf("%d text blocks for f, want 1", len(blocks)) + } + goCode := blocks[0] fn := img.Funcs[0] gasmCode := maskCode(append([]byte(nil), img.Code[fn.Offset:fn.Offset+fn.Size]...), fn.Relocs) - goCode = maskCode(append([]byte(nil), goCode...), fn.Relocs) cmpLen := min(len(goCode), len(gasmCode)) if !bytes.Equal(gasmCode[:cmpLen], goCode[:cmpLen]) { t.Errorf("bytes differ:\ngasm: % x\ngo: % x", gasmCode[:cmpLen], goCode[:cmpLen])