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])