issue #198 Test cases for op_mov, op_br, op_cbr

ravi-compiler
Dibyendu Majumdar 4 years ago
parent 4f7cab694c
commit 4819f38a80

@ -1,4 +1,5 @@
f = compiler.load("local a, b, c = 4.2, true, 'hi' return a, b, c")
assert(f and type(f) == 'function')
local z = 62
local a,b,c,d = f()
assert(z == 62)

@ -0,0 +1,3 @@
f = compiler.load("local a,b = 1,2 return a or b");
assert(f and type(f) == 'function')
assert(f() == 1)

@ -0,0 +1,3 @@
f = compiler.load("local a,b = 1,2 return a and b");
assert(f and type(f) == 'function')
assert(f() == 2)

@ -0,0 +1,3 @@
f = compiler.load("local a = 2 return 1 or a");
assert(f and type(f) == 'function')
assert(f() == 1)

@ -0,0 +1,3 @@
f = compiler.load("local a = 2 return 1 and a");
assert(f and type(f) == 'function')
assert(f() == 2)
Loading…
Cancel
Save