[Tarantool-patches] [PATCH luajit 22/36] test: enable <misc/phi_conv.lua> LuaJIT test
Sergey Kaplun
skaplun at tarantool.org
Wed Aug 14 16:56:04 MSK 2024
This patch moves the aforementioned test from the <misc> to the
<trace/phi/> directory, includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---
.../{misc/phi_conv.lua => trace/phi/conv.lua} | 35 ++++++++++---------
test/LuaJIT-tests/trace/phi/index | 1 +
2 files changed, 20 insertions(+), 16 deletions(-)
rename test/LuaJIT-tests/{misc/phi_conv.lua => trace/phi/conv.lua} (67%)
diff --git a/test/LuaJIT-tests/misc/phi_conv.lua b/test/LuaJIT-tests/trace/phi/conv.lua
similarity index 67%
rename from test/LuaJIT-tests/misc/phi_conv.lua
rename to test/LuaJIT-tests/trace/phi/conv.lua
index 8d7bea5f..7f46d445 100644
--- a/test/LuaJIT-tests/misc/phi_conv.lua
+++ b/test/LuaJIT-tests/trace/phi/conv.lua
@@ -1,18 +1,5 @@
-
local bit = require("bit")
-local Rm = {}
-for i=0,16 do Rm[i] = 0 end
-
-for k=1,10 do
- local seed = 1
- for i=16,0,-1 do
- seed = bit.band(seed*9069, 0x7fffffff)
- Rm[i] = seed
- end
- assert(seed == 1952688301)
-end
-
local retindex = 0
local retdata = { 3, 1, 1, 1, 0, 3, 1, 0, 0, 2, 0, 2, 0, 0, 3, 1, 1, 1, 1 }
@@ -42,12 +29,28 @@ local function decodeCode()
end
local function test()
- for i = 1, 6 do
+ for _ = 1, 6 do
decodeCode()
end
end
-if jit and jit.status and jit.status() then jit.opt.start("hotloop=1") end
+do --- PHI for CONV num.int before ASTORE.
+ local Rm = {}
+ for i = 0, 16 do Rm[i] = 0 end
-test()
+ for _ = 1,10 do
+ local seed = 1
+ for i = 16, 0, -1 do
+ seed = bit.band(seed*9069, 0x7fffffff)
+ Rm[i] = seed
+ end
+ assert(seed == 1952688301)
+ end
+end
+
+do --- PHI for CONV num.int of lookup.
+ jit.opt.start("hotloop=1")
+ test()
+ jit.opt.start("hotloop=56")
+end
diff --git a/test/LuaJIT-tests/trace/phi/index b/test/LuaJIT-tests/trace/phi/index
index 74a07333..a72d37a0 100644
--- a/test/LuaJIT-tests/trace/phi/index
+++ b/test/LuaJIT-tests/trace/phi/index
@@ -1,3 +1,4 @@
copyspill.lua
+conv.lua
ref.lua
rotate.lua
--
2.45.2
More information about the Tarantool-patches
mailing list