add register names to allocator

make platform instantiate it
basic plumbing
This commit is contained in:
2020-03-18 15:27:40 +02:00
parent 500df01425
commit 8df1b8126f
5 changed files with 32 additions and 16 deletions

View File

@ -12,5 +12,9 @@ module Risc
def test_factory_raise
assert_raises{ Platform.for("NotArm")}
end
def test_allocate
allocator = Platform.new.allocator(FakeCompiler.new)
assert_equal FakeCompiler , allocator.compiler.class
end
end
end

View File

@ -16,6 +16,9 @@ module Risc
def test_empty
assert @allocator.used_regs_empty?
end
def test_reg_names
assert_equal 16 , @allocator.reg_names.length
end
def test_compiler
assert_equal CallableCompiler , @allocator.compiler.class
assert_equal :fake_name , @allocator.compiler.callable.name