Added more tests
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user