Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <m.kokryashkin@tarantool.org>,
	Sergey Bronnikov <sergeyb@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH luajit 33/36] test: enable <misc/unordered_jit.lua> LuaJIT test
Date: Wed, 14 Aug 2024 16:56:15 +0300	[thread overview]
Message-ID: <e302ee8e90a1374d611205213778d3acd7c482dd.1723638851.git.skaplun@tarantool.org> (raw)
In-Reply-To: <cover.1723638851.git.skaplun@tarantool.org>

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

Part of tarantool/tarantool#9398
---
 test/LuaJIT-tests/misc/unordered_jit.lua  |  96 ---------
 test/LuaJIT-tests/trace/index             |   1 +
 test/LuaJIT-tests/trace/unordered_jit.lua | 240 ++++++++++++++++++++++
 3 files changed, 241 insertions(+), 96 deletions(-)
 delete mode 100644 test/LuaJIT-tests/misc/unordered_jit.lua
 create mode 100644 test/LuaJIT-tests/trace/unordered_jit.lua

diff --git a/test/LuaJIT-tests/misc/unordered_jit.lua b/test/LuaJIT-tests/misc/unordered_jit.lua
deleted file mode 100644
index 5ff1a1ba..00000000
--- a/test/LuaJIT-tests/misc/unordered_jit.lua
+++ /dev/null
@@ -1,96 +0,0 @@
-
-local nan = 0/0
-local t = {}
-for i=1,100 do t[i] = i+0.5 end
-for i=101,200 do t[i] = nan end
-
-do
-  local z = 0
-  for i=1,200 do if t[i] > 1000 then z=i end end
-  assert(z == 0)
-end
-
-do
-  local z = 0
-  for i=1,200 do if not (t[i] < 1000) then z=i end end
-  assert(z == 200)
-end
-
-do
-  local z = 0
-  for i=1,200 do if t[i] <= 1000 then z=i end end
-  assert(z == 100)
-end
-
-do
-  local z = 0
-  for i=1,200 do if not (t[i] >= 1000) then z=i end end
-  assert(z == 200)
-end
-
-do
-  local z = 0
-  for i=1,200 do if t[i] > 0 then z=i end end
-  assert(z == 100)
-end
-
-do
-  local z = 0
-  for i=1,200 do if not (t[i] < 0) then z=i end end
-  assert(z == 200)
-end
-
-do
-  local z = 0
-  for i=1,200 do if t[i] <= 0 then z=i end end
-  assert(z == 0)
-end
-
-do
-  local z = 0
-  for i=1,200 do if not (t[i] >= 0) then z=i end end
-  assert(z == 200)
-end
-
-do local z; for i=1,100 do z = 0/0 end; assert(z ~= z) end
-
-do local z; for i=1,100 do z = nan == nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan == 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 == nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = nan ~= nan end; assert(z == true) end
-do local z; for i=1,100 do z = nan ~= 1 end; assert(z == true) end
-do local z; for i=1,100 do z = 1 ~= nan end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan < nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan < 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 < nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan < nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan < 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 < nan) end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan > nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan > 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 > nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan > nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan > 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 > nan) end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan <= nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan <= 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 <= nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan <= nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan <= 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 <= nan) end; assert(z == true) end
-
-do local z; for i=1,100 do z = nan >= nan end; assert(z == false) end
-do local z; for i=1,100 do z = nan >= 1 end; assert(z == false) end
-do local z; for i=1,100 do z = 1 >= nan end; assert(z == false) end
-
-do local z; for i=1,100 do z = not (nan >= nan) end; assert(z == true) end
-do local z; for i=1,100 do z = not (nan >= 1) end; assert(z == true) end
-do local z; for i=1,100 do z = not (1 >= nan) end; assert(z == true) end
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 1b8fb8f4..c7fbbe57 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -12,3 +12,4 @@ stack_purge.lua
 stitch.lua
 tcall_base.lua
 tcall_loop.lua
+unordered_jit.lua
diff --git a/test/LuaJIT-tests/trace/unordered_jit.lua b/test/LuaJIT-tests/trace/unordered_jit.lua
new file mode 100644
index 00000000..0aa7bde3
--- /dev/null
+++ b/test/LuaJIT-tests/trace/unordered_jit.lua
@@ -0,0 +1,240 @@
+-- All cases below use constants on the trace.
+local nan = 0/0
+local t = {}
+for i = 1, 100 do t[i] = i + 0.5 end
+for i = 101, 200 do t[i] = nan end
+
+do --- Branch is never taken, NaN > 1000.
+  local z = 0
+  for i = 1, 200 do if t[i] > 1000 then z = i end end
+  assert(z == 0)
+end
+
+do --- Branch begins to be taken on the trace, not (NaN < 1000).
+  local z = 0
+  for i = 1, 200 do if not (t[i] < 1000) then z = i end end
+  assert(z == 200)
+end
+
+do --- Branch ends to be taken on the trace, NaN <= 1000.
+  local z = 0
+  for i = 1, 200 do if t[i] <= 1000 then z = i end end
+  assert(z == 100)
+end
+
+do --- Branch is always taken, not (NaN >= 1000).
+  local z = 0
+  for i = 1, 200 do if not (t[i] >= 1000) then z = i end end
+  assert(z == 200)
+end
+
+do --- Branch ends to be taken on the trace, NaN > 0.
+  local z = 0
+  for i = 1, 200 do if t[i] > 0 then z = i end end
+  assert(z == 100)
+end
+
+do --- Branch is always taken, not (NaN < 0).
+  local z = 0
+  for i = 1, 200 do if not (t[i] < 0) then z = i end end
+  assert(z == 200)
+end
+
+do --- Branch is never taken, NaN <= 0.
+  local z = 0
+  for i = 1, 200 do if t[i] <= 0 then z = i end end
+  assert(z == 0)
+end
+
+do --- Branch begins to be taken on the trace, not (NaN >= 0).
+  local z = 0
+  for i = 1, 200 do if not (t[i] >= 0) then z = i end end
+  assert(z == 200)
+end
+
+do --- NaN assign on trace.
+  local z
+  for _ = 1, 100 do z = 0/0 end
+  assert(z ~= z)
+end
+
+do --- Nan == NaN.
+  local z
+  for _ = 1, 100 do z = nan == nan end
+  assert(z == false)
+end
+
+do --- NaN == 1.
+  local z
+  for _ = 1, 100 do z = nan == 1 end
+  assert(z == false)
+end
+
+do --- 1 == NaN.
+  local z
+  local z
+  for _ = 1, 100 do z = 1 == nan end
+  assert(z == false)
+end
+
+do --- NaN ~= NaN.
+  local z
+  for _ = 1, 100 do z = nan ~= nan end
+  assert(z == true)
+end
+
+do --- NaN ~= 1.
+  local z
+  for _ = 1, 100 do z = nan ~= 1 end
+  assert(z == true)
+end
+
+do --- 1 ~= NaN.
+  local z
+  for _ = 1, 100 do z = 1 ~= nan end
+  assert(z == true)
+end
+
+do --- NaN < NaN.
+  local z
+  for _ = 1, 100 do z = nan < nan end
+  assert(z == false)
+end
+
+do --- NaN < 1.
+  local z
+  for _ = 1, 100 do z = nan < 1 end
+  assert(z == false)
+end
+
+do --- 1 < NaN.
+  local z
+  for _ = 1, 100 do z = 1 < nan end
+  assert(z == false)
+end
+
+do --- not (NaN < NaN).
+  local z
+  for _ = 1, 100 do z = not (nan < nan) end
+  assert(z == true)
+end
+
+do --- not (NaN < 1).
+  local z
+  for _ = 1, 100 do z = not (nan < 1) end
+  assert(z == true)
+end
+
+do --- not (1 < NaN).
+  local z
+  for _ = 1, 100 do z = not (1 < nan) end
+  assert(z == true)
+end
+
+do --- NaN > NaN.
+  local z
+  for _ = 1, 100 do z = nan > nan end
+  assert(z == false)
+end
+
+do --- NaN > 1.
+  local z
+  for _ = 1, 100 do z = nan > 1 end
+  assert(z == false)
+end
+
+do --- 1 > NaN.
+  local z
+  for _ = 1, 100 do z = 1 > nan end
+  assert(z == false)
+end
+
+do --- not (NaN > NaN).
+  local z
+  for _ = 1, 100 do z = not (nan > nan) end
+  assert(z == true)
+end
+
+do --- not (NaN > 1).
+  local z
+  for _ = 1, 100 do z = not (nan > 1) end
+  assert(z == true)
+end
+
+do --- not (1 > NaN).
+  local z
+  for _ = 1, 100 do z = not (1 > nan) end
+  assert(z == true)
+end
+
+do --- NaN <= NaN.
+  local z
+  for _ = 1, 100 do z = nan <= nan end
+  assert(z == false)
+end
+
+do --- NaN <= 1.
+  local z
+  for _ = 1, 100 do z = nan <= 1 end
+  assert(z == false)
+end
+
+do --- 1 <= NaN.
+  local z
+  for _ = 1, 100 do z = 1 <= nan end
+  assert(z == false)
+end
+
+do --- not (NaN <= NaN).
+  local z
+  for _ = 1, 100 do z = not (nan <= nan) end
+  assert(z == true)
+end
+
+do --- not (NaN <= 1).
+  local z
+  for _ = 1, 100 do z = not (nan <= 1) end
+  assert(z == true)
+end
+
+do --- not (1 <= NaN).
+  local z
+  for _ = 1, 100 do z = not (1 <= nan) end
+  assert(z == true)
+end
+
+do --- NaN >= NaN.
+  local z
+  for _ = 1, 100 do z = nan >= nan end
+  assert(z == false)
+end
+
+do --- NaN >= 1.
+  local z
+  for _ = 1, 100 do z = nan >= 1 end
+  assert(z == false)
+end
+
+do --- 1 >= NaN.
+  local z
+  for _ = 1, 100 do z = 1 >= nan end
+  assert(z == false)
+end
+
+do --- not (NaN >= NaN).
+  local z
+  for _ = 1, 100 do z = not (nan >= nan) end
+  assert(z == true)
+end
+
+do --- not (NaN >= 1).
+  local z
+  for _ = 1, 100 do z = not (nan >= 1) end
+  assert(z == true)
+end
+
+do --- not (1 >= NaN).
+  local z
+  for _ = 1, 100 do z = not (1 >= nan) end
+  assert(z == true)
+end
-- 
2.45.2


  parent reply	other threads:[~2024-08-14 14:13 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 13:55 [Tarantool-patches] [PATCH luajit 00/36] Rearrange LuaJIT misc tests Sergey Kaplun via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 01/36] test: don't run JIT-based LuaJIT tests without JIT Sergey Kaplun via Tarantool-patches
2024-08-15 12:47   ` Sergey Bronnikov via Tarantool-patches
2024-08-19  8:47     ` Sergey Kaplun via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 02/36] test: enable <misc/alias_alloc.lua> LuaJIT test Sergey Kaplun via Tarantool-patches
2024-08-15 12:51   ` Sergey Bronnikov via Tarantool-patches
2024-08-15 13:31     ` Sergey Kaplun via Tarantool-patches
2024-08-30  7:25       ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 03/36] test: refactor <lang/coroutine.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:00   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 04/36] test: remove <misc/coro_yield.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:05   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 05/36] test: enable <misc/debug_gc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:09   ` Sergey Bronnikov via Tarantool-patches
2024-08-15 13:25     ` Sergey Kaplun via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 06/36] test: enable <misc/dualnum.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:11   ` Sergey Bronnikov via Tarantool-patches
2024-08-15 13:19     ` Sergey Bronnikov via Tarantool-patches
2024-08-15 13:22       ` Sergey Kaplun via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 07/36] test: remove <misc/fori_coerce.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:20   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 08/36] test: remove <misc/fori_dir.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:21   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 09/36] test: remove <misc/gc_rechain.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:22   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 10/36] test: enable <misc/gc_trace.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:24   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 11/36] test: enable <misc/gcstep.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:34   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 12/36] test: enable <misc/hook_active.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:38   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 13/36] test: enable <misc/hook_line.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:42   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 14/36] test: enable <misc/hook_norecord.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:56   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 15/36] test: enable <misc/hook_record.lua> " Sergey Kaplun via Tarantool-patches
2024-08-15 13:57   ` Sergey Bronnikov via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 16/36] test: enable <misc/hook_top.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:55 ` [Tarantool-patches] [PATCH luajit 17/36] test: enable <misc/jit_flush.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 18/36] test: remove <misc/loop_unroll.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 19/36] test: enable <misc/parse_comp.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 20/36] test: enable <misc/parse_esc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 21/36] test: enable <misc/parse_misc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 22/36] test: enable <misc/phi_conv.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 23/36] test: enable <misc/recurse_deep.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 24/36] test: remove <misc/recurse_tail.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 25/36] test: enable <misc/stack_gc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 26/36] test: enable <misc/stack_purge.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 27/36] test: enable <misc/stackov.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 28/36] test: enable <misc/stackovc.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 29/36] test: enable <misc/tcall_base.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 30/36] test: enable <misc/tcall_loop.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 31/36] test: enable <misc/tonumber_scan.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 32/36] test: remove <misc/uclo.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` Sergey Kaplun via Tarantool-patches [this message]
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 34/36] test: enable <misc/wbarrier.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 35/36] test: enable <misc/wbarrier_jit.lua> " Sergey Kaplun via Tarantool-patches
2024-08-14 13:56 ` [Tarantool-patches] [PATCH luajit 36/36] test: enable <misc/wbarrier_obar.lua> " Sergey Kaplun via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e302ee8e90a1374d611205213778d3acd7c482dd.1723638851.git.skaplun@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 33/36] test: enable <misc/unordered_jit.lua> LuaJIT test' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox