diff --git a/src/build/arch/x64/Jump_test.go b/src/build/arch/x64/Jump_test.go index ba48db0..5c12133 100644 --- a/src/build/arch/x64/Jump_test.go +++ b/src/build/arch/x64/Jump_test.go @@ -7,7 +7,7 @@ import ( "git.akyoto.dev/go/assert" ) -func TestJump8(t *testing.T) { +func TestJump(t *testing.T) { usagePatterns := []struct { Offset int8 Code []byte @@ -29,3 +29,12 @@ func TestJump8(t *testing.T) { assert.DeepEqual(t, code, pattern.Code) } } + +func TestConditionalJump(t *testing.T) { + assert.DeepEqual(t, x64.Jump8IfEqual(nil, 1), []byte{0x74, 0x01}) + assert.DeepEqual(t, x64.Jump8IfNotEqual(nil, 1), []byte{0x75, 0x01}) + assert.DeepEqual(t, x64.Jump8IfLess(nil, 1), []byte{0x7C, 0x01}) + assert.DeepEqual(t, x64.Jump8IfGreaterOrEqual(nil, 1), []byte{0x7D, 0x01}) + assert.DeepEqual(t, x64.Jump8IfLessOrEqual(nil, 1), []byte{0x7E, 0x01}) + assert.DeepEqual(t, x64.Jump8IfGreater(nil, 1), []byte{0x7F, 0x01}) +}