[Tarantool-patches] [PATCH luajit 29/36] test: enable <misc/tcall_base.lua> LuaJIT test

Sergey Kaplun skaplun at tarantool.org
Wed Aug 14 16:56:11 MSK 2024


This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtest.

Part of tarantool/tarantool#9398
---
 test/LuaJIT-tests/trace/index                    |  1 +
 test/LuaJIT-tests/{misc => trace}/tcall_base.lua | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
 rename test/LuaJIT-tests/{misc => trace}/tcall_base.lua (62%)

diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 4826f429..9de3b478 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -10,3 +10,4 @@ phi
 snap.lua
 stack_purge.lua
 stitch.lua
+tcall_base.lua
diff --git a/test/LuaJIT-tests/misc/tcall_base.lua b/test/LuaJIT-tests/trace/tcall_base.lua
similarity index 62%
rename from test/LuaJIT-tests/misc/tcall_base.lua
rename to test/LuaJIT-tests/trace/tcall_base.lua
index c6c4ae1a..b048db19 100644
--- a/test/LuaJIT-tests/misc/tcall_base.lua
+++ b/test/LuaJIT-tests/trace/tcall_base.lua
@@ -1,4 +1,3 @@
-
 local r = 0
 local function g()
   r = r + 1
@@ -6,7 +5,7 @@ local function g()
 end
 
 local function f()
-  for j=1,20 do
+  for j = 1, 20 do
     if j > 19 then
       return g() -- Tailcall at base.
       -- Let this link to the already compiled loop in g().
@@ -14,7 +13,8 @@ local function f()
   end
 end
 
-g() -- Compile this loop first.
-for i=1,50 do f() end
-assert(r == 51)
-
+do --- Recording tailcall at base.
+  g() -- Compile this loop first.
+  for _ = 1, 50 do f() end
+  assert(r == 51)
+end
-- 
2.45.2



More information about the Tarantool-patches mailing list