rubyx/test/elf/test_something.rb
Torsten Rüger 12b29285d7 Lots of preloading for tests
so many relied (implicitly( on some builtin function
after all can't do much in ruby without calling
Now all those dependencies are explicit
Small risc changes come because the macro version has a return label and unreachable label
2019-09-13 14:07:12 +03:00

30 lines
516 B
Ruby

require_relative "helper"
module Elf
class SomethingTest < FullTest
include Preloader
def test_add
input = <<HERE
def fibo( n)
a = 0
b = 1
i = 1
while( i < n ) do
result = a + b
a = b
b = result
i += 1
end
return result
end
def main(arg)
return fibo(8)
end
HERE
@exit_code = 4
check get_preload("Integer.lt;Integer.plus") + in_space(input) , "fibo"
end
end
end