Added more tests

This commit is contained in:
2025-03-24 23:17:51 +01:00
parent ae928156c5
commit 33b91e7bf4
4 changed files with 26 additions and 6 deletions

View File

@ -27,3 +27,19 @@ func TestCompareRegisterNumber(t *testing.T) {
assert.DeepEqual(t, code, pattern.Code)
}
}
func TestCompareRegisterRegister(t *testing.T) {
usagePatterns := []struct {
Left cpu.Register
Right cpu.Register
Code uint32
}{
{arm.X0, arm.X1, 0xEB01001F},
}
for _, pattern := range usagePatterns {
t.Logf("cmp %s, %s", pattern.Left, pattern.Right)
code := arm.CompareRegisterRegister(pattern.Left, pattern.Right)
assert.DeepEqual(t, code, pattern.Code)
}
}