rubyx/test/elf/test_hello.rb

21 lines
519 B
Ruby
Raw Normal View History

2015-10-14 12:48:42 +02:00
require_relative "../helper"
class HelloTest < MiniTest::Test
2016-12-08 18:39:16 +01:00
include AST::Sexp
def check
2015-10-22 17:16:29 +02:00
machine = Register.machine.boot
2017-01-14 18:52:16 +01:00
Vm.compile_ast( @input )
objects = Register::Collector.collect_space
machine.translate_arm
writer = Elf::ObjectWriter.new(machine , objects )
2016-12-15 17:08:55 +01:00
writer.save "test/hello.o"
end
def test_string_put
@input = s(:statements, s(:return, s(:call, s(:name, :putstring), s(:arguments),
s(:receiver, s(:string, "Hello again\\n")))))
2016-12-31 14:08:32 +01:00
check
end
end