issue #198 Tests for op_call instruction - couple fail due to missing support for multiret in return

mir-nonssa
Dibyendu Majumdar 4 years ago
parent d0b3ed989b
commit 69840eacdb

@ -0,0 +1,5 @@
function g() return 4.2 end
f = compiler.load('return g()')
assert(f and type(f) == 'function')
local a = f()
assert(a == 4.2)

@ -0,0 +1,6 @@
function g() return 3, 4.2 end
f = compiler.load('return g()')
assert(f and type(f) == 'function')
local a, b = f()
assert(a == 3)
assert(b == 4.2)

@ -0,0 +1,6 @@
function g() return 3, 4.2 end
f = compiler.load('return g(), 1')
assert(f and type(f) == 'function')
local a, b = f()
assert(a == 3)
assert(b == 1)

@ -0,0 +1,7 @@
function g() return 3, 4.2 end
f = compiler.load('return 0, g(), 1')
assert(f and type(f) == 'function')
local a, b, c = f()
assert(a == 0)
assert(b == 3)
assert(c == 1)

@ -0,0 +1,11 @@
g = compiler.load('return 3, 4.2')
assert(g and type(g) == 'function')
local a, b = g()
assert(a == 3)
assert(b == 4.2)
f = compiler.load('return 0, g(), 1')
assert(f and type(f) == 'function')
local a, b, c = f()
assert(a == 0)
assert(b == 3)
assert(c == 1)
Loading…
Cancel
Save