2015-10-14 12:48:42 +02:00
|
|
|
require_relative "../helper"
|
2014-08-21 21:57:20 +02:00
|
|
|
|
|
|
|
class HelloTest < MiniTest::Test
|
2016-12-08 18:39:16 +01:00
|
|
|
include AST::Sexp
|
2015-05-16 11:53:10 +02:00
|
|
|
|
2014-08-21 21:57:20 +02:00
|
|
|
def check
|
2017-01-19 08:02:29 +01:00
|
|
|
machine = Risc.machine.boot
|
2017-01-14 18:52:16 +01:00
|
|
|
Vm.compile_ast( @input )
|
2017-01-19 08:02:29 +01:00
|
|
|
objects = Risc::Collector.collect_space
|
2015-10-24 10:42:36 +02:00
|
|
|
machine.translate_arm
|
2016-12-31 17:46:17 +01:00
|
|
|
writer = Elf::ObjectWriter.new(machine , objects )
|
2016-12-15 17:08:55 +01:00
|
|
|
writer.save "test/hello.o"
|
2014-08-21 21:57:20 +02:00
|
|
|
end
|
|
|
|
|
2018-03-11 12:32:42 +01:00
|
|
|
def pest_string_put
|
2017-01-16 08:34:47 +01:00
|
|
|
@input = s(:statements, s(:return, s(:call, :putstring, s(:arguments),
|
2016-12-16 23:19:23 +01:00
|
|
|
s(:receiver, s(:string, "Hello again\\n")))))
|
2016-12-31 14:08:32 +01:00
|
|
|
check
|
2014-08-21 21:57:20 +02:00
|
|
|
end
|
2015-05-16 11:53:10 +02:00
|
|
|
end
|