rubyx/test/mom/assign/test_assign_local_send.rb

27 lines
727 B
Ruby
Raw Normal View History

2018-03-19 16:28:53 +05:30
require_relative '../helper'
module Risc
class TestAssignLocalSend < MiniTest::Test
include Statements
def setup
super
@input = "r = 5.div4;return"
2019-08-23 15:31:04 +03:00
@expect = [LoadConstant, RegToSlot, LoadConstant, SlotToReg, RegToSlot, #4
LoadConstant, SlotToReg, RegToSlot, SlotToReg, FunctionCall, #9
Label, SlotToReg, RegToSlot, LoadConstant, RegToSlot, #14
Branch,] #19
end
def test_local_assign_instructions
assert_nil msg = check_nil , msg
end
2018-03-21 18:54:42 +05:30
def test_constant_load
produced = produce_body
2019-08-23 15:31:04 +03:00
load = produced.next(2)
2018-04-06 23:37:41 +03:00
assert_equal LoadConstant , load.class
assert_equal 5 , load.constant.value
end
end
end