setting registers in the allocator

unfortunately the reg instances are spread across instructions
this causes problems when setting them
This commit is contained in:
2020-03-20 16:15:11 +02:00
parent c890e8402b
commit d2e7c647d0
3 changed files with 44 additions and 7 deletions

View File

@ -13,11 +13,20 @@ module Risc
end
def test_allocate_runs
assert_nil @allocator.allocate_regs
assert_equal 0 , @allocator.used_regs.length
#assert_equal 0 , @allocator.used_regs.length
end
def test_live_length
live = @allocator.walk_and_mark(@compiler.risc_instructions)
assert_equal 10 , live.length
end
def test_ssa
instruction = @compiler.risc_instructions.next(2)
assert_equal :"message.next_message" , instruction.register.symbol
end
def est_risc
assert_nil @allocator.allocate_regs
instruction = @compiler.risc_instructions.next(2)
assert_equal :"message.next_message" , instruction.register.symbol
end
end
end