large test changes due to change in cc

calling convention does affect
less than before, but still a LOT
This commit is contained in:
Torsten Ruger
2018-08-12 15:02:23 +03:00
parent fee9e261a5
commit 86462e238a
27 changed files with 335 additions and 415 deletions

View File

@ -7,36 +7,33 @@ module Risc
def setup
super
@input = "5.div4"
@expect = [LoadConstant, LoadConstant, SlotToReg, RegToSlot, RegToSlot,
SlotToReg, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
RegToSlot, RegToSlot, SlotToReg, RegToSlot, LoadConstant,
SlotToReg, RegToSlot, LoadConstant, SlotToReg, RegToSlot,
SlotToReg, FunctionCall, Label]
@expect = [LoadConstant, LoadConstant, SlotToReg, SlotToReg, RegToSlot,
RegToSlot, RegToSlot, RegToSlot, LoadConstant, SlotToReg,
RegToSlot, LoadConstant, SlotToReg, RegToSlot, SlotToReg,
FunctionCall, Label]
end
def test_send_instructions
assert_nil msg = check_nil , msg
end
def test_load_5
produced = produce_body
assert_equal 5 , produced.next(14).constant.value
produced = produce_body.next(8)
assert_load( produced , Parfait::Integer)
assert_equal 5 , produced.constant.value
end
def test_load_label
produced = produce_body
assert_equal Label , produced.next(17).constant.class
end
def test_call_reg_setup
produced = produce_body
assert_equal :div4 , produced.next(21).method.name
produced = produce_body.next(11)
assert_load( produced , Label)
end
def test_function_call
produced = produce_body
assert_equal FunctionCall , produced.next(21).class
assert_equal :div4 , produced.next(21).method.name
produced = produce_body.next(15)
assert_equal FunctionCall , produced.class
assert_equal :div4 , produced.method.name
end
def test_check_continue
produced = produce_body
assert produced.next(22).name.start_with?("continue_")
produced = produce_body.next(16)
assert_equal Label , produced.class
assert produced.name.start_with?("continue_")
end
#TODO check the message setup, type and frame moves
end