Fix non ssa issue
register instances were being shared across instructions causing the setting to have side-effects Fixed this by copying the register on write (fixing the symptom rather than the cause, i'll make an issue)
This commit is contained in:
@ -24,6 +24,11 @@ module Risc
|
||||
def test_r0
|
||||
assert_equal :message , @r0.symbol
|
||||
end
|
||||
def test_dup
|
||||
copy = @r0.dup( :r0 )
|
||||
assert_equal :r0 , copy.symbol
|
||||
assert_equal :message , copy.ssa
|
||||
end
|
||||
def test_load_label
|
||||
label = Risc::Label.new("HI","ho" , FakeAddress.new(0))
|
||||
move = @r1 << label
|
||||
|
@ -53,12 +53,5 @@ module Risc
|
||||
def test_has_ssa
|
||||
assert_nil @r0.ssa
|
||||
end
|
||||
def test_set_name
|
||||
assert_equal :message , @r0.set_name(:r0)
|
||||
end
|
||||
def test_set_ssa
|
||||
@r0.set_name(:r0)
|
||||
assert_equal :message , @r0.ssa
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -13,7 +13,7 @@ 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)
|
||||
|
Reference in New Issue
Block a user