2014-05-21 20:37:04 +02:00
|
|
|
require_relative 'helper'
|
|
|
|
|
|
|
|
class TestFoo < MiniTest::Test
|
|
|
|
include Fragments
|
|
|
|
|
2015-07-18 13:33:09 +02:00
|
|
|
def test_foo2
|
2014-05-21 20:37:04 +02:00
|
|
|
@string_input = <<HERE
|
2015-10-05 23:27:13 +02:00
|
|
|
class Object
|
|
|
|
int foo(int x)
|
|
|
|
int a = 5
|
|
|
|
return a
|
|
|
|
end
|
|
|
|
|
|
|
|
int main()
|
|
|
|
foo( 4 )
|
|
|
|
end
|
2014-05-30 09:42:43 +02:00
|
|
|
end
|
2014-05-21 20:37:04 +02:00
|
|
|
HERE
|
2015-10-18 16:39:35 +02:00
|
|
|
@expect = [ [SaveReturn,Register::GetSlot,Virtual::Set,Virtual::Set,
|
2015-10-18 16:32:32 +02:00
|
|
|
Virtual::Set,Virtual::Set,Virtual::MethodCall] ,[RegisterTransfer,GetSlot,FunctionReturn] ]
|
2015-07-18 13:33:09 +02:00
|
|
|
check
|
2014-05-21 20:37:04 +02:00
|
|
|
end
|
|
|
|
|
2015-07-18 13:33:09 +02:00
|
|
|
|
|
|
|
end
|