Convert SimpleCall to new regs
Also fix bug in RegsiterValue/Slot with chain, where logic was dodgy and compiler not set
This commit is contained in:
@ -72,4 +72,27 @@ module Risc
|
||||
assert_equal :message , inst.array.symbol
|
||||
end
|
||||
end
|
||||
class TestRegisterSlot4 < MiniTest::Test
|
||||
def setup
|
||||
Parfait.boot!(Parfait.default_test_options)
|
||||
@compiler = Risc.test_compiler
|
||||
@r0 = RegisterValue.new(:message , :Message).set_compiler(@compiler)
|
||||
@r0[:next_message][:return_address] << @r0
|
||||
end
|
||||
def test_instructions
|
||||
assert_equal SlotToReg , @compiler.risc_instructions.next(1).class
|
||||
assert_equal RegToSlot , @compiler.risc_instructions.next(2).class
|
||||
assert_equal NilClass , @compiler.risc_instructions.next(3).class
|
||||
end
|
||||
def test_slot_to
|
||||
slot = @compiler.risc_instructions.next(1)
|
||||
assert_slot_to_reg slot , :message, 1, :"message.next_message"
|
||||
assert slot.register.compiler
|
||||
end
|
||||
def test_reg_to
|
||||
reg = @compiler.risc_instructions.next(2)
|
||||
assert_reg_to_slot reg , :message, :"message.next_message" , 4
|
||||
assert reg.register.compiler
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user