fix the exit sequence
was returning wrong register (1, not 0) also saving the message for test, which changes order as the return value destroys the message
This commit is contained in:
@ -14,9 +14,8 @@ module Risc
|
||||
check_main_chain [LoadConstant, LoadConstant, OperatorInstruction, IsZero, LoadConstant,
|
||||
OperatorInstruction, IsZero, LoadConstant, RegToSlot, SlotToReg,
|
||||
SlotToReg, RegToSlot, SlotToReg, Branch, SlotToReg,
|
||||
SlotToReg, FunctionReturn, SlotToReg, SlotToReg, Branch,
|
||||
Transfer, Syscall, NilClass]
|
||||
assert_equal Fixnum , get_return.class
|
||||
SlotToReg, FunctionReturn, Transfer, SlotToReg, Branch,
|
||||
SlotToReg, Syscall, NilClass]
|
||||
assert_equal 1 , get_return
|
||||
end
|
||||
def test_load_10
|
||||
|
@ -24,9 +24,8 @@ module Risc
|
||||
SlotToReg, SlotToReg, LoadConstant, OperatorInstruction, IsZero,
|
||||
LoadConstant, RegToSlot, SlotToReg, SlotToReg, Branch,
|
||||
RegToSlot, SlotToReg, SlotToReg, SlotToReg, FunctionReturn,
|
||||
SlotToReg, SlotToReg, Branch, Transfer, Syscall,
|
||||
Transfer, SlotToReg, Branch, SlotToReg, Syscall,
|
||||
NilClass]
|
||||
assert_equal Fixnum , get_return.class
|
||||
assert_equal 2 , get_return
|
||||
end
|
||||
def test_exit
|
||||
|
@ -24,9 +24,8 @@ module Risc
|
||||
SlotToReg, SlotToReg, LoadConstant, OperatorInstruction, IsZero,
|
||||
LoadConstant, OperatorInstruction, IsZero, LoadConstant, Branch,
|
||||
RegToSlot, SlotToReg, SlotToReg, RegToSlot, SlotToReg,
|
||||
SlotToReg, SlotToReg, FunctionReturn, SlotToReg, SlotToReg,
|
||||
Branch, Transfer, Syscall, NilClass]
|
||||
assert_equal Fixnum , get_return.class
|
||||
SlotToReg, SlotToReg, FunctionReturn, Transfer, SlotToReg,
|
||||
Branch, SlotToReg, Syscall, NilClass]
|
||||
assert_equal 1 , get_return
|
||||
end
|
||||
def test_exit
|
||||
|
@ -24,9 +24,8 @@ module Risc
|
||||
SlotToReg, SlotToReg, LoadConstant, OperatorInstruction, IsZero,
|
||||
LoadConstant, RegToSlot, SlotToReg, SlotToReg, Branch,
|
||||
RegToSlot, SlotToReg, SlotToReg, SlotToReg, FunctionReturn,
|
||||
SlotToReg, SlotToReg, Branch, Transfer, Syscall,
|
||||
Transfer, SlotToReg, Branch, SlotToReg, Syscall,
|
||||
NilClass]
|
||||
assert_equal Fixnum , get_return.class
|
||||
assert_equal 2 , get_return
|
||||
end
|
||||
def test_exit
|
||||
|
@ -24,9 +24,8 @@ module Risc
|
||||
SlotToReg, SlotToReg, LoadConstant, OperatorInstruction, IsZero,
|
||||
LoadConstant, OperatorInstruction, IsZero, LoadConstant, Branch,
|
||||
RegToSlot, SlotToReg, SlotToReg, RegToSlot, SlotToReg,
|
||||
SlotToReg, SlotToReg, FunctionReturn, SlotToReg, SlotToReg,
|
||||
Branch, Transfer, Syscall, NilClass]
|
||||
assert_equal Fixnum , get_return.class
|
||||
SlotToReg, SlotToReg, FunctionReturn, Transfer, SlotToReg,
|
||||
Branch, SlotToReg, Syscall, NilClass]
|
||||
assert_equal 1 , get_return
|
||||
end
|
||||
def test_exit
|
||||
|
Reference in New Issue
Block a user