[Tarantool-patches] [PATCH v2 luajit 27/45] test: refactor <trace/phi/conv.lua> LuaJIT test

Sergey Bronnikov sergeyb at tarantool.org
Thu Aug 22 16:41:09 MSK 2024


Sergey,

On 21.08.2024 11:58, Sergey Kaplun wrote:
> This patch refactors the aforementioned test to make its code style
> closer to ours.
>
> Relates to tarantool/tarantool#9398
> ---
thanks for the patch! LGTM
>   test/LuaJIT-tests/trace/phi/conv.lua | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/test/LuaJIT-tests/trace/phi/conv.lua b/test/LuaJIT-tests/trace/phi/conv.lua
> index 267423c2..45383ed7 100644
> --- a/test/LuaJIT-tests/trace/phi/conv.lua
> +++ b/test/LuaJIT-tests/trace/phi/conv.lua
> @@ -15,7 +15,7 @@ local maskhuf = { 0x0002, 0x0003, 0x0004, 0x0005, }
>   local function decodeCode()
>     local lookup = get_bits()
>     local code = hufcodes[lookup]
> -  local z = {1,1,1,1}
> +  local z = {1, 1, 1, 1}
>     if not code then
>       for i = 1, 4 do
>         lookup = bit.bor(lookup, bit.lshift(get_bits(), i + 1))
> @@ -29,19 +29,19 @@ local function decodeCode()
>   end
>   
>   local function test()
> -  for i = 1, 6 do
> +  for _ = 1, 6 do
>       decodeCode()
>     end
>   end
>   
>   do --- PHI for CONV num.int before ASTORE.
>     local Rm = {}
> -  for i=0,16 do Rm[i] = 0 end
> +  for i = 0, 16 do Rm[i] = 0 end
>   
> -  for k=1,10 do
> +  for _ = 1, 10 do
>       local seed = 1
> -    for i=16,0,-1 do
> -      seed = bit.band(seed*9069, 0x7fffffff)
> +    for i = 16, 0, -1 do
> +      seed = bit.band(seed * 9069, 0x7fffffff)
>         Rm[i] = seed
>       end
>       assert(seed == 1952688301)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20240822/586e2c48/attachment.htm>


More information about the Tarantool-patches mailing list