rubyx/test/elf/test_hello.rb
Torsten Ruger f8cefcde3c retiring ClassField and class_field from typed layer
Creating classes is the responsibility of melon
2016-12-16 19:05:49 +02:00

23 lines
630 B
Ruby

require_relative "../helper"
class HelloTest < MiniTest::Test
include AST::Sexp
def check
machine = Register.machine.boot
Typed.compile( @input )
machine.collect
machine.translate_arm
writer = Elf::ObjectWriter.new
writer.save "test/hello.o"
end
def test_string_put
@input = s(:statements, s(:class, :Space, s(:derives, nil),
s(:statements, s(:function, :Integer, s(:name, :main), s(:parameters),
s(:statements, s(:return, s(:call, s(:name, :putstring), s(:arguments),
s(:receiver, s(:string, "Hello again\\n")))))))))
check
end
end