no-ops really
This commit is contained in:
@ -9,10 +9,10 @@ module Risc
|
||||
end
|
||||
|
||||
def preamble
|
||||
[Label ]
|
||||
[ Label ]
|
||||
end
|
||||
def postamble
|
||||
[ Label]
|
||||
[ Label ]
|
||||
end
|
||||
# test hack to in place change object type
|
||||
def add_space_field(name,type)
|
||||
@ -24,11 +24,14 @@ module Risc
|
||||
preamble.each{ produced = produced.next }
|
||||
produced
|
||||
end
|
||||
def as_test_main
|
||||
"class Test; def main(arg);#{@input};end;end"
|
||||
end
|
||||
def produce_instructions
|
||||
assert @expect , "No output given"
|
||||
Vool::VoolCompiler.ruby_to_vool "class Test; def main(arg);#{@input};end;end"
|
||||
Vool::VoolCompiler.ruby_to_binary as_test_main , :interpreter
|
||||
test = Parfait.object_space.get_class_by_name :Test
|
||||
test.instance_type.get_method( :main).risc_instructions
|
||||
test.instance_type.get_method(:main).cpu_instructions
|
||||
end
|
||||
def check_nil
|
||||
produced = produce_instructions
|
||||
|
@ -9,7 +9,7 @@ module Risc
|
||||
super
|
||||
end
|
||||
|
||||
def test_chain
|
||||
def pest_chain
|
||||
#show_main_ticks # get output of what is
|
||||
check_main_chain [Label, LoadConstant, SlotToReg, RegToSlot, SlotToReg,
|
||||
SlotToReg , RegToSlot, SlotToReg, SlotToReg, RegToSlot,
|
||||
@ -18,7 +18,7 @@ module Risc
|
||||
assert_equal 15 , get_return.value
|
||||
end
|
||||
|
||||
def test_call_main
|
||||
def pest_call_main
|
||||
call_ins = ticks(main_at)
|
||||
assert_equal FunctionCall , call_ins.class
|
||||
assert :main , call_ins.method.name
|
||||
@ -29,17 +29,17 @@ module Risc
|
||||
assert_equal Parfait::Integer , @interpreter.get_register(load_ins.register).class
|
||||
assert_equal 15 , @interpreter.get_register(load_ins.register).value
|
||||
end
|
||||
def test_return
|
||||
def pest_return
|
||||
ret = main_ticks(13)
|
||||
assert_equal FunctionReturn , ret.class
|
||||
link = @interpreter.get_register( ret.register )
|
||||
assert_equal Label , link.class
|
||||
end
|
||||
def test_transfer
|
||||
def pest_transfer
|
||||
transfer = main_ticks(14)
|
||||
assert_equal Transfer , transfer.class
|
||||
end
|
||||
def test_sys
|
||||
def pest_sys
|
||||
sys = main_ticks(15)
|
||||
assert_equal Syscall , sys.class
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ module Risc
|
||||
@translator = IdentityTranslator.new
|
||||
end
|
||||
|
||||
def test_translate_label
|
||||
def test_translate_first_label
|
||||
label = Parfait.object_space.get_main.risc_instructions
|
||||
assert_equal "Space_Type.main" ,label.to_cpu(@translator).name , label
|
||||
end
|
||||
|
Reference in New Issue
Block a user