fix(asm): adapt the flag list integration test to the paired oracle
Test / test (push) Successful in 31s
Test / test (push) Successful in 31s
Assisted-by: GLM 5.3 Flash
This commit is contained in:
1 parent
a9ee2bc702
commit
e5df0a9d84
1 file changed
+5
-2
@@ -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])
|
||||
|
||||
Reference in new issue
Block a user