2020-03-17 20:46:57 +01:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
module Risc
|
|
|
|
class TestCallableCompiler1 < MiniTest::Test
|
|
|
|
include SolCompile
|
|
|
|
|
|
|
|
def setup
|
|
|
|
@compiler = compile_main("return 5").to_risc
|
|
|
|
@platform = Platform.for(:arm)
|
|
|
|
end
|
|
|
|
def test_init
|
|
|
|
@compiler.risc_instructions.each do |ins|
|
2020-03-22 17:01:51 +01:00
|
|
|
ins.register_names.each do |name|
|
|
|
|
assert ! RegisterValue.look_like_reg(name)
|
|
|
|
end
|
2020-03-17 20:46:57 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_1
|
|
|
|
@compiler.translate_method( @platform , [])
|
2020-03-22 17:01:51 +01:00
|
|
|
@compiler.risc_instructions.each do |ins|
|
|
|
|
ins.register_names.each do |name|
|
|
|
|
assert RegisterValue.look_like_reg(name)
|
|
|
|
end
|
|
|
|
end
|
2020-03-17 20:46:57 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|