Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit v2 0/5] Adjust tests to be run when JIT is disabled
@ 2023-02-28 19:00 Igor Munkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 1/5] Minor fixes Igor Munkin via Tarantool-patches
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-02-28 19:00 UTC (permalink / raw)
  To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches

This series make LuaJIT tests work when JIT is either disabled or turned
off. It looks large a bit, but it's not complex at all.

The first patch is a backport of a tiny change fixing header
dependencies for the build with -DLUAJIT_DISABLE_JIT=ON and whitespace
inconsistency (that is a bit irrelevant, but IMHO still OK).

The second patch is quite similar to the first one, but relates to the
changes made in our fork (sysprof, memprof, etc).

The third patch disables all JIT-related tests in tarantool-tests suite
via skipcond introduced in the separate series[1].

The fourth patch fixes <compiled_with_jit> condition according to its
usage in lua-Harness suite.

The last patch introduces a new flavor to exotic builds matrix to test
builds with JIT disabled.

Changes in v2:
- Moved test enhancements to a separate series[1]

Issue: https://github.com/tarantool/tarantool/issues/8252
Branch: https://github.com/tarantool/luajit/commits/imun/jit-off-ci
Tarantool PR: https://github.com/tarantool/tarantool/pull/8288
CI: https://github.com/tarantool/luajit/commit/6aa9059

[1]: https://lists.tarantool.org/tarantool-patches/cover.1677236706.git.imun@tarantool.org/T/#t

Igor Munkin (4):
  build: fix build with JIT disabled
  test: add skipcond for all JIT-related tests
  test: fix lua-Harness JIT-related tests
  ci: add nojit flavor for exotic builds

Mike Pall (1):
  Minor fixes.

 .github/workflows/exotic-builds-testing.yml         |  4 +++-
 src/lib_base.c                                      |  2 +-
 src/lj_gc.c                                         |  1 +
 src/lj_memprof.c                                    |  9 ++++-----
 src/lj_symtab.c                                     | 13 +++----------
 src/lj_symtab.h                                     |  2 ++
 test/lua-Harness-tests/403-jit.t                    |  2 +-
 test/lua-Harness-tests/411-luajit.t                 |  2 +-
 test/tarantool-tests/bc-jit-unpatching.test.lua     |  6 ++++--
 .../fix-fold-simplify-conv-sext.test.lua            |  7 ++++---
 .../fix-slot-check-for-mm-record.test.lua           |  4 +++-
 test/tarantool-tests/gh-4199-gc64-fuse.test.lua     |  1 +
 test/tarantool-tests/gh-4427-ffi-sandwich.test.lua  |  1 +
 .../gh-4476-fix-string-find-recording.test.lua      |  4 +++-
 .../gh-5813-resolving-of-c-symbols.test.lua         |  4 +++-
 .../gh-6065-jit-library-smoke-tests.test.lua        |  4 +++-
 ...gh-6098-fix-side-exit-patching-on-arm64.test.lua |  5 ++++-
 test/tarantool-tests/gh-6189-cur_L.test.lua         |  7 +++++--
 ...6227-bytecode-allocator-for-comparisons.test.lua |  5 ++++-
 .../gh-6371-string-char-no-arg.test.lua             |  5 +++--
 .../gh-6782-stitching-in-vmevent-handler.test.lua   |  6 ++++--
 .../gh-6976-narrowing-of-unary-minus.test.lua       |  5 ++++-
 ...gh-7264-add-proto-trace-sysprof-default.test.lua |  1 +
 .../tarantool-tests/lj-350-sload-typecheck.test.lua |  8 +++++---
 .../lj-356-ir-khash-non-string-obj.test.lua         | 11 +++++++----
 test/tarantool-tests/lj-357-arm64-hrefk.test.lua    |  6 ++++--
 .../lj-375-ir-bufput-signed-char.test.lua           |  4 +++-
 .../lj-408-tonumber-cdata-record.test.lua           | 11 ++++++-----
 test/tarantool-tests/lj-416-xor-before-jcc.test.lua |  6 ++++--
 test/tarantool-tests/lj-430-maxirconst.test.lua     |  1 +
 .../lj-505-fold-no-strref-for-ptrdiff.test.lua      |  4 +++-
 .../lj-524-fold-conv-respect-src-irt.test.lua       |  6 ++++--
 .../lj-556-fix-loop-realignment.test.lua            |  4 +++-
 .../lj-584-bad-renames-for-sunk-values.test.lua     |  4 +++-
 .../lj-603-err-snap-restore.test.lua                |  1 +
 .../lj-672-cdata-allocation-recording.test.lua      |  1 +
 .../lj-864-varg-rec-base-offset.test.lua            |  6 ++++--
 test/tarantool-tests/lj-flush-on-trace.test.lua     |  1 +
 .../misclib-getmetrics-capi.test.lua                |  1 +
 .../misclib-getmetrics-lapi.test.lua                |  1 +
 test/tarantool-tests/misclib-memprof-lapi.test.lua  |  2 +-
 test/tarantool-tests/misclib-sysprof-capi.test.lua  |  5 +++--
 test/tarantool-tests/misclib-sysprof-lapi.test.lua  |  5 +++--
 43 files changed, 122 insertions(+), 66 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Tarantool-patches] [PATCH luajit v2 1/5] Minor fixes.
  2023-02-28 19:00 [Tarantool-patches] [PATCH luajit v2 0/5] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches
@ 2023-02-28 19:00 ` Igor Munkin via Tarantool-patches
  2023-03-01 19:25   ` Maxim Kokryashkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 2/5] build: fix build with JIT disabled Igor Munkin via Tarantool-patches
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-02-28 19:00 UTC (permalink / raw)
  To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches

From: Mike Pall <mike>

(cherry picked from commit 54484e257f24c47d71b8233844e2ec8664db8071)

This is a tiny patch fixing header dependencies for the build with
-DLUAJIT_DISABLE_JIT=ON and whitespace inconsistency.

Igor Munkin:
* added the description

Part of tarantool/tarantool#8069

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 src/lib_base.c | 2 +-
 src/lj_gc.c    | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib_base.c b/src/lib_base.c
index 398c4f65..eb6da054 100644
--- a/src/lib_base.c
+++ b/src/lib_base.c
@@ -505,7 +505,7 @@ LJLIB_CF(print)
     tv = L->top-1;
   }
   shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring)
-              && !gcrefu(basemt_it(G(L), LJ_TNUMX));
+	      && !gcrefu(basemt_it(G(L), LJ_TNUMX));
   for (i = 0; i < nargs; i++) {
     cTValue *o = &L->base[i];
     const char *str;
diff --git a/src/lj_gc.c b/src/lj_gc.c
index 29387a48..c306047a 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -25,6 +25,7 @@
 #include "lj_cdata.h"
 #endif
 #include "lj_trace.h"
+#include "lj_dispatch.h"
 #include "lj_vm.h"
 
 #define GCSTEPSIZE	1024u
-- 
2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Tarantool-patches] [PATCH luajit v2 2/5] build: fix build with JIT disabled
  2023-02-28 19:00 [Tarantool-patches] [PATCH luajit v2 0/5] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 1/5] Minor fixes Igor Munkin via Tarantool-patches
@ 2023-02-28 19:00 ` Igor Munkin via Tarantool-patches
  2023-03-01 19:27   ` Maxim Kokryashkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests Igor Munkin via Tarantool-patches
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-02-28 19:00 UTC (permalink / raw)
  To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches

struct GCtrace is defined only if LJ_HASJIT is set. Hence, all spots
where GCtrace is used should be also moved under LJ_HASJIT define.

Relates to tarantool/tarantool#8252

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 src/lj_memprof.c |  9 ++++-----
 src/lj_symtab.c  | 13 +++----------
 src/lj_symtab.h  |  2 ++
 3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/lj_memprof.c b/src/lj_memprof.c
index d4a639fd..8cab8204 100644
--- a/src/lj_memprof.c
+++ b/src/lj_memprof.c
@@ -369,6 +369,8 @@ void lj_memprof_add_proto(const struct GCproto *pt)
   lj_symtab_dump_proto(&mp->out, pt);
 }
 
+#if LJ_HASJIT
+
 void lj_memprof_add_trace(const struct GCtrace *tr)
 {
   struct memprof *mp = &memprof;
@@ -380,6 +382,8 @@ void lj_memprof_add_trace(const struct GCtrace *tr)
   lj_symtab_dump_trace(&mp->out, tr);
 }
 
+#endif /* LJ_HASJIT */
+
 #else /* LJ_HASMEMPROF */
 
 int lj_memprof_start(struct lua_State *L, const struct lj_memprof_options *opt)
@@ -401,9 +405,4 @@ void lj_memprof_add_proto(const struct GCproto *pt)
   UNUSED(pt);
 }
 
-void lj_memprof_add_trace(const struct GCtrace *tr)
-{
-  UNUSED(tr);
-}
-
 #endif /* LJ_HASMEMPROF */
diff --git a/src/lj_symtab.c b/src/lj_symtab.c
index 91ee9a72..54984c05 100644
--- a/src/lj_symtab.c
+++ b/src/lj_symtab.c
@@ -53,16 +53,7 @@ void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace)
   lj_wbuf_addu64(out, (uint64_t)lineno);
 }
 
-#else
-
-static void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace)
-{
-  UNUSED(out);
-  UNUSED(trace);
-  lua_assert(0);
-}
-
-#endif
+#endif /* LJ_HASJIT */
 
 void lj_symtab_dump_proto(struct lj_wbuf *out, const GCproto *pt)
 {
@@ -491,11 +482,13 @@ void lj_symtab_dump(struct lj_wbuf *out, const struct global_State *g,
       lj_symtab_dump_proto(out, pt);
       break;
     }
+#if LJ_HASJIT
     case (~LJ_TTRACE): {
       lj_wbuf_addbyte(out, SYMTAB_TRACE);
       lj_symtab_dump_trace(out, gco2trace(o));
       break;
     }
+#endif /* LJ_HASJIT */
     default:
       break;
     }
diff --git a/src/lj_symtab.h b/src/lj_symtab.h
index 6faa5cb1..6ec0cd7c 100644
--- a/src/lj_symtab.h
+++ b/src/lj_symtab.h
@@ -60,10 +60,12 @@
 #define SYMTAB_TRACE ((uint8_t)2)
 #define SYMTAB_FINAL ((uint8_t)0x80)
 
+#if LJ_HASJIT
 /*
 ** Dumps traceinfo into the symbol table.
 */
 void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace);
+#endif /* LJ_HASJIT */
 
 /*
 ** Dumps function prototype.
-- 
2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests
  2023-02-28 19:00 [Tarantool-patches] [PATCH luajit v2 0/5] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 1/5] Minor fixes Igor Munkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 2/5] build: fix build with JIT disabled Igor Munkin via Tarantool-patches
@ 2023-02-28 19:00 ` Igor Munkin via Tarantool-patches
  2023-03-01 10:04   ` Sergey Kaplun via Tarantool-patches
  2023-03-01 19:28   ` Maxim Kokryashkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 4/5] test: fix lua-Harness " Igor Munkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 5/5] ci: add nojit flavor for exotic builds Igor Munkin via Tarantool-patches
  4 siblings, 2 replies; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-02-28 19:00 UTC (permalink / raw)
  To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches

This patch adjusts all tests for JIT engine to avoid failures when JIT
is disabled, so skipcond with the result of <jit.status> as a condition
is added to handle this.

Part of tarantool/tarantool#8252

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 test/tarantool-tests/bc-jit-unpatching.test.lua       |  6 ++++--
 .../fix-fold-simplify-conv-sext.test.lua              |  7 ++++---
 .../fix-slot-check-for-mm-record.test.lua             |  4 +++-
 test/tarantool-tests/gh-4199-gc64-fuse.test.lua       |  1 +
 test/tarantool-tests/gh-4427-ffi-sandwich.test.lua    |  1 +
 .../gh-4476-fix-string-find-recording.test.lua        |  4 +++-
 .../gh-5813-resolving-of-c-symbols.test.lua           |  4 +++-
 .../gh-6065-jit-library-smoke-tests.test.lua          |  4 +++-
 .../gh-6098-fix-side-exit-patching-on-arm64.test.lua  |  5 ++++-
 test/tarantool-tests/gh-6189-cur_L.test.lua           |  7 +++++--
 ...h-6227-bytecode-allocator-for-comparisons.test.lua |  5 ++++-
 .../gh-6371-string-char-no-arg.test.lua               |  5 +++--
 .../gh-6782-stitching-in-vmevent-handler.test.lua     |  6 ++++--
 .../gh-6976-narrowing-of-unary-minus.test.lua         |  5 ++++-
 .../gh-7264-add-proto-trace-sysprof-default.test.lua  |  1 +
 test/tarantool-tests/lj-350-sload-typecheck.test.lua  |  8 +++++---
 .../lj-356-ir-khash-non-string-obj.test.lua           | 11 +++++++----
 test/tarantool-tests/lj-357-arm64-hrefk.test.lua      |  6 ++++--
 .../lj-375-ir-bufput-signed-char.test.lua             |  4 +++-
 .../lj-408-tonumber-cdata-record.test.lua             | 11 ++++++-----
 test/tarantool-tests/lj-416-xor-before-jcc.test.lua   |  6 ++++--
 test/tarantool-tests/lj-430-maxirconst.test.lua       |  1 +
 .../lj-505-fold-no-strref-for-ptrdiff.test.lua        |  4 +++-
 .../lj-524-fold-conv-respect-src-irt.test.lua         |  6 ++++--
 .../lj-556-fix-loop-realignment.test.lua              |  4 +++-
 .../lj-584-bad-renames-for-sunk-values.test.lua       |  4 +++-
 test/tarantool-tests/lj-603-err-snap-restore.test.lua |  1 +
 .../lj-672-cdata-allocation-recording.test.lua        |  1 +
 .../lj-864-varg-rec-base-offset.test.lua              |  6 ++++--
 test/tarantool-tests/lj-flush-on-trace.test.lua       |  1 +
 test/tarantool-tests/misclib-getmetrics-capi.test.lua |  1 +
 test/tarantool-tests/misclib-getmetrics-lapi.test.lua |  1 +
 test/tarantool-tests/misclib-memprof-lapi.test.lua    |  2 +-
 test/tarantool-tests/misclib-sysprof-capi.test.lua    |  5 +++--
 test/tarantool-tests/misclib-sysprof-lapi.test.lua    |  5 +++--
 35 files changed, 106 insertions(+), 47 deletions(-)

diff --git a/test/tarantool-tests/bc-jit-unpatching.test.lua b/test/tarantool-tests/bc-jit-unpatching.test.lua
index 71247f0c..2c3b7c9a 100644
--- a/test/tarantool-tests/bc-jit-unpatching.test.lua
+++ b/test/tarantool-tests/bc-jit-unpatching.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-local utils = require('utils')
+local test = tap.test('bc-jit-unpatching'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('bc-jit-unpatching')
 test:plan(1)
 
+local utils = require('utils')
 -- Function with up-recursion.
 local function f(n)
   return n < 2 and n or f(n - 1) + f(n - 2)
diff --git a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
index 07e22c36..60eb3e7c 100644
--- a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
+++ b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
@@ -1,12 +1,13 @@
 local tap = require('tap')
-local ffi = require('ffi')
-
-local test = tap.test('fix-fold-simplify-conv-sext')
+local test = tap.test('fix-fold-simplify-conv-sext'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
 local NSAMPLES = 4
 local NTEST = NSAMPLES * 2 - 1
 test:plan(NTEST)
 
+local ffi = require('ffi')
 local samples = ffi.new('int [?]', NSAMPLES)
 
 -- Prepare data.
diff --git a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
index 8df72ec4..6161747f 100644
--- a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
+++ b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
@@ -1,7 +1,9 @@
 -- luacheck: globals a0 a1
 local tap = require('tap')
+local test = tap.test('fix-slot-check-for-mm-record'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('fix-slot-check-for-mm-record')
 test:plan(1)
 
 -- Before the patch, JIT compiler doesn't check slots overflow
diff --git a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
index 65f9faac..4513d43b 100644
--- a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
+++ b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('gh-4199-gc64-fuse'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Test requires GC64 mode enabled'] = not require('ffi').abi('gc64'),
 })
 
diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
index ed3f50d1..86544196 100644
--- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
+++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('gh-4427-ffi-sandwich'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
index f48af173..0758b38f 100644
--- a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
+++ b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test("gh-4476-fix-string-find-recording"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test("gh-4476-fix-string-find-recording")
 test:plan(1)
 
 local err = [[module 'kit.1.10.3-136' not found:
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
index 3c6833fc..9f2c5f85 100644
--- a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
+++ b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
@@ -8,7 +8,9 @@ local test = tap.test("gh-5813-resolving-of-c-symbols"):skipcond({
 test:plan(5)
 
 jit.off()
-jit.flush()
+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
+-- thrown when LuaJIT is compiled with JIT engine disabled.
+pcall(jit.flush)
 
 local bufread = require "utils.bufread"
 local symtab = require "utils.symtab"
diff --git a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
index 7110e351..5d7fd7e2 100644
--- a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
+++ b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('gh-6065-jit-library-smoke-tests'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('gh-6065-jit-library-smoke-tests')
 test:plan(1)
 
 -- Just check whether LuaJIT is built with JIT support. Otherwise,
diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
index 4dcf3e22..cfcc6adb 100644
--- a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
+++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
@@ -1,5 +1,8 @@
 local tap = require('tap')
-local test = tap.test('gh-6098-fix-side-exit-patching-on-arm64')
+local test = tap.test('gh-6098-fix-side-exit-patching-on-arm64'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 -- The function to be tested for side exit patching:
diff --git a/test/tarantool-tests/gh-6189-cur_L.test.lua b/test/tarantool-tests/gh-6189-cur_L.test.lua
index 7f2184ec..a5096a7c 100644
--- a/test/tarantool-tests/gh-6189-cur_L.test.lua
+++ b/test/tarantool-tests/gh-6189-cur_L.test.lua
@@ -1,9 +1,12 @@
-local libcur_L = require('libcur_L')
 local tap = require('tap')
+local test = tap.test('gh-6189-cur_L'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('gh-6189-cur_L')
 test:plan(1)
 
+local libcur_L = require('libcur_L')
+
 local function cbool(cond)
   if cond then
     return 1
diff --git a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
index 9788923a..da399bcf 100644
--- a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
+++ b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
@@ -1,5 +1,8 @@
 local tap = require('tap')
-local test = tap.test('gh-6227-bytecode-allocator-for-comparisons')
+local test = tap.test('gh-6227-bytecode-allocator-for-comparisons'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 -- Test file to demonstrate assertion failure during recording
diff --git a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
index ec871d19..90121860 100644
--- a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
+++ b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
@@ -1,10 +1,11 @@
 local tap = require('tap')
-
 -- Test file to demonstrate assertion after `string.char()`
 -- recording.
 -- See also, https://github.com/tarantool/tarantool/issues/6371.
+local test = tap.test('gh-6371-string-char-no-arg'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('gh-6371-string-char-no-arg')
 -- XXX: Number of loop iterations.
 -- * 1 -- instruction becomes hot.
 -- * 2 -- recording of the loop body.
diff --git a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
index 6087e5ae..385e7648 100644
--- a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
+++ b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-
 -- Test file to demonstrate incorrect stitching behaviour
 -- in vmevent handler.
 -- See also https://github.com/tarantool/tarantool/issues/6782.
-local test = tap.test('gh-6782-stitching-in-vmevent-handler')
+local test = tap.test('gh-6782-stitching-in-vmevent-handler'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 -- Just dump bytecodes is enough.
diff --git a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
index b4792f59..40387cca 100644
--- a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
+++ b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
@@ -1,5 +1,8 @@
 local tap = require('tap')
-local test = tap.test('gh-6976-narrowing-of-unary-minus')
+local test = tap.test('gh-6976-narrowing-of-unary-minus'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(2)
 
 jit.opt.start('hotloop=1')
diff --git a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
index 472bc2d1..9cce32cb 100644
--- a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
+++ b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('gh-7264-add-proto-trace-sysprof-default'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Sysprof is implemented for x86_64 only'] = jit.arch ~= 'x86' and
                                                jit.arch ~= 'x64',
   ['Sysprof is implemented for Linux only'] = jit.os ~= 'Linux',
diff --git a/test/tarantool-tests/lj-350-sload-typecheck.test.lua b/test/tarantool-tests/lj-350-sload-typecheck.test.lua
index 33794943..5b25864d 100644
--- a/test/tarantool-tests/lj-350-sload-typecheck.test.lua
+++ b/test/tarantool-tests/lj-350-sload-typecheck.test.lua
@@ -1,13 +1,15 @@
 local tap = require('tap')
-local traceinfo = require('jit.util').traceinfo
-
 -- Test file to demonstrate the incorrect GC64 JIT asembling
 -- `IR_SLOAD`.
 -- See also https://github.com/LuaJIT/LuaJIT/pull/350.
-local test = tap.test('lj-350-sload-typecheck')
+local test = tap.test('lj-350-sload-typecheck'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
 test:plan(1)
 
+local traceinfo = require('jit.util').traceinfo
+
 -- Contains only IR_SLOAD after recording.
 local function sload(arg)
   return arg
diff --git a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
index 7f304183..9977205d 100644
--- a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
+++ b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
@@ -1,17 +1,20 @@
 local tap = require('tap')
-local traceinfo = require('jit.util').traceinfo
-local table_new = require('table.new')
-
 -- Test file to demonstrate the incorrect GC64 JIT behaviour
 -- of an `IR_HREF` for the on-trace-constant key lookup.
 -- See also https://github.com/LuaJIT/LuaJIT/pull/356.
-local test = tap.test('lj-356-ir-khash-non-string-obj')
+local test = tap.test('lj-356-ir-khash-non-string-obj'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 local N_ITERATIONS = 4
 
 -- Amount of iteration for trace compilation and execution and
 -- additional check, that there is no new trace compiled.
 test:plan(N_ITERATIONS + 1)
 
+local traceinfo = require('jit.util').traceinfo
+local table_new = require('table.new')
+
 -- To reproduce the issue we need to compile a trace with
 -- `IR_HREF`, with a lookup of constant hash key GC value. To
 -- prevent an `IR_HREFK` to be emitted instead, we need a table
diff --git a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
index 8af9143a..d7e9c85e 100644
--- a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
+++ b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-
 -- Test file to demonstrate the incorrect JIT behaviour for HREFK
 -- IR compilation on arm64.
 -- See also https://github.com/LuaJIT/LuaJIT/issues/357.
-local test = tap.test('lj-357-arm64-hrefk')
+local test = tap.test('lj-357-arm64-hrefk'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(2)
 
 jit.opt.start('hotloop=1', 'hotexit=1')
diff --git a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
index 7c8df948..f600d898 100644
--- a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
+++ b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('lj-375-ir-bufput-signed-char'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-375-ir-bufput-signed-char')
 -- XXX: Number of loop iterations.
 -- 1 -- instruction becomes hot
 -- 2, 3 -- trace is recorded (considering loop recording
diff --git a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
index a8235e93..bdd0aaaa 100644
--- a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
+++ b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
@@ -1,18 +1,19 @@
-local ffi = require('ffi')
 local tap = require('tap')
-
 -- Test file to demonstrate the incorrect JIT recording for
 -- `tonumber()` function with cdata argument for failed
 -- conversions.
 -- See also https://github.com/LuaJIT/LuaJIT/issues/408,
 -- https://github.com/LuaJIT/LuaJIT/pull/412,
 -- https://github.com/tarantool/tarantool/issues/7655.
-local test = tap.test('lj-408-tonumber-cdata-record')
-
-local NULL = ffi.cast('void *', 0)
+local test = tap.test('lj-408-tonumber-cdata-record'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
 test:plan(4)
 
+local ffi = require('ffi')
+local NULL = ffi.cast('void *', 0)
+
 local function check(x)
   -- Don't use a tail call to avoid "leaving loop in root trace"
   -- error, so the trace will be compiled.
diff --git a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
index f9a2a869..861114e8 100644
--- a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
+++ b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
@@ -1,7 +1,8 @@
-local ffi = require('ffi')
 local tap = require('tap')
+local test = tap.test('lj-416-xor-before-jcc'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-416-xor-before-jcc')
 test:plan(1)
 
 -- To reproduce this issue, we need:
@@ -30,6 +31,7 @@ test:plan(1)
 -- ucomisd and the jnb, thereby causing the jnb to do the wrong
 -- thing.
 
+local ffi = require('ffi')
 ffi.cdef[[
   int test_xor_func(int a, int b, int c, int d, int e, int f, void * g, int h);
 ]]
diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua b/test/tarantool-tests/lj-430-maxirconst.test.lua
index 633ab676..531acd7d 100644
--- a/test/tarantool-tests/lj-430-maxirconst.test.lua
+++ b/test/tarantool-tests/lj-430-maxirconst.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('lj-430-maxirconst'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
index 2866fb12..fec08b30 100644
--- a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
+++ b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test("lj-505-fold-icorrect-behavior"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test("lj-505-fold-icorrect-behavior")
 test:plan(1)
 
 -- Test file to demonstrate Lua fold machinery icorrect behavior, details:
diff --git a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
index cd0f0f04..b2ccae63 100644
--- a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
+++ b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
@@ -1,9 +1,11 @@
 local tap = require('tap')
-local ffi = require('ffi')
+local test = tap.test("or-524-fold-icorrect-behavior"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test("or-524-fold-icorrect-behavior")
 test:plan(1)
 
+local ffi = require('ffi')
 -- Test file to demonstrate LuaJIT folding machinery incorrect behaviour,
 -- details:
 --     https://github.com/LuaJIT/LuaJIT/issues/524
diff --git a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
index 6015f55f..b94bd3e9 100644
--- a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
+++ b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('lj-556-fix-loop-realignment'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-556-fix-loop-realignment')
 test:plan(1)
 
 -- Test file to demonstrate JIT misbehaviour for loop realignment
diff --git a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
index f037c898..e0c3e577 100644
--- a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
+++ b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
@@ -1,6 +1,8 @@
 local tap = require('tap')
+local test = tap.test('lj-584-bad-renames-for-sunk-values'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
 
-local test = tap.test('lj-584-bad-renames-for-sunk-values')
 test:plan(1)
 
 -- Test file to demonstrate LuaJIT assembler misbehaviour.
diff --git a/test/tarantool-tests/lj-603-err-snap-restore.test.lua b/test/tarantool-tests/lj-603-err-snap-restore.test.lua
index be54a5f3..6eb53dfd 100644
--- a/test/tarantool-tests/lj-603-err-snap-restore.test.lua
+++ b/test/tarantool-tests/lj-603-err-snap-restore.test.lua
@@ -40,6 +40,7 @@ recursive_f()
 test:ok(true)
 
 test:skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
   -- XXX: The different amount of stack slots is in-use for
   -- Tarantool at start, so just skip test for it.
diff --git a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
index 2165afe3..1d6b19ba 100644
--- a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
+++ b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('lj-672-cdata-allocation-recording'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
index d74c3c2b..d41e33ff 100644
--- a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
+++ b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
@@ -1,10 +1,12 @@
 local tap = require('tap')
-
 -- Test file to demonstrate LuaJIT misbehaviour during recording
 -- BC_VARG with nvarargs >= nresults in GC64 mode.
 -- See also https://github.com/LuaJIT/LuaJIT/issues/864,
 -- https://github.com/tarantool/tarantool/issues/7172.
-local test = tap.test('lj-864-varg-rec-base-offset')
+local test = tap.test('lj-864-varg-rec-base-offset'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
+})
+
 test:plan(1)
 
 jit.opt.start('hotloop=1')
diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua b/test/tarantool-tests/lj-flush-on-trace.test.lua
index 099e9650..46db4d2a 100644
--- a/test/tarantool-tests/lj-flush-on-trace.test.lua
+++ b/test/tarantool-tests/lj-flush-on-trace.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test('lj-flush-on-trace'):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
index c5a91955..654e5545 100644
--- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua
+++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
@@ -1,5 +1,6 @@
 local tap = require('tap')
 local test = tap.test("clib-misc-getmetrics"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
index e71bc239..881e717b 100644
--- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
+++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
@@ -4,6 +4,7 @@
 
 local tap = require('tap')
 local test = tap.test("lib-misc-getmetrics"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
 })
 
diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua
index 18c8aaab..4e413c88 100644
--- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
+++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua
@@ -1,8 +1,8 @@
 -- XXX: This comment is a reminder to reimplement memprof tests
 -- assertions to make them more indepentent to the changes made.
--- Now I just leave this 3 lines comment to preserve line numbers.
 local tap = require("tap")
 local test = tap.test("misc-memprof-lapi"):skipcond({
+  ['Test requires JIT enabled'] = not jit.status(),
   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
   ["Memprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
                                                jit.arch ~= "x64",
diff --git a/test/tarantool-tests/misclib-sysprof-capi.test.lua b/test/tarantool-tests/misclib-sysprof-capi.test.lua
index a9b712a5..5c062195 100644
--- a/test/tarantool-tests/misclib-sysprof-capi.test.lua
+++ b/test/tarantool-tests/misclib-sysprof-capi.test.lua
@@ -9,9 +9,10 @@ test:plan(2)
 
 local testsysprof = require("testsysprof")
 
-local jit = require('jit')
-
 jit.off()
+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
+-- thrown when LuaJIT is compiled with JIT engine disabled.
+pcall(jit.flush)
 
 test:ok(testsysprof.base())
 test:ok(testsysprof.validation())
diff --git a/test/tarantool-tests/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/misclib-sysprof-lapi.test.lua
index fff89dfd..96eaaab6 100644
--- a/test/tarantool-tests/misclib-sysprof-lapi.test.lua
+++ b/test/tarantool-tests/misclib-sysprof-lapi.test.lua
@@ -8,7 +8,9 @@ local test = tap.test("misc-sysprof-lapi"):skipcond({
 test:plan(19)
 
 jit.off()
-jit.flush()
+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
+-- thrown when LuaJIT is compiled with JIT engine disabled.
+pcall(jit.flush)
 
 local bufread = require("utils.bufread")
 local symtab = require("utils.symtab")
@@ -127,5 +129,4 @@ check_mode("C", 100)
 
 os.remove(TMP_BINFILE)
 
-jit.on()
 os.exit(test:check() and 0 or 1)
-- 
2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Tarantool-patches] [PATCH luajit v2 4/5] test: fix lua-Harness JIT-related tests
  2023-02-28 19:00 [Tarantool-patches] [PATCH luajit v2 0/5] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches
                   ` (2 preceding siblings ...)
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests Igor Munkin via Tarantool-patches
@ 2023-02-28 19:00 ` Igor Munkin via Tarantool-patches
  2023-03-01 10:08   ` Sergey Kaplun via Tarantool-patches
  2023-03-01 19:30   ` Maxim Kokryashkin via Tarantool-patches
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 5/5] ci: add nojit flavor for exotic builds Igor Munkin via Tarantool-patches
  4 siblings, 2 replies; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-02-28 19:00 UTC (permalink / raw)
  To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches

lua-Harness considers whether JIT is enabled or not in the scope of the
403-jit.t and 411-luajit.t tests. However, the original condition is
wrong, since <jit.status> yields false for both cases, when JIT is just
turned off and when LuaJIT is built without compiler support. So, if
<jit.status> yields false, the latter case is considered. The condition
is fixed to differ both aforementioned cases in the following way: when
jit.opt is nil, LuaJIT is built without compiler; otherwise, JIT support
is on board.

Part of tarantool/tarantool#8252

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 test/lua-Harness-tests/403-jit.t    | 2 +-
 test/lua-Harness-tests/411-luajit.t | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/lua-Harness-tests/403-jit.t b/test/lua-Harness-tests/403-jit.t
index 0f986da9..1a88564b 100755
--- a/test/lua-Harness-tests/403-jit.t
+++ b/test/lua-Harness-tests/403-jit.t
@@ -31,7 +31,7 @@ if not jit then
     skip_all("only with LuaJIT")
 end
 
-local compiled_with_jit = jit.status()
+local compiled_with_jit = jit.opt ~= nil
 local luajit20 = jit.version_num < 20100 and not jit.version:match'RaptorJIT'
 local has_jit_opt = compiled_with_jit
 local has_jit_security = jit.security
diff --git a/test/lua-Harness-tests/411-luajit.t b/test/lua-Harness-tests/411-luajit.t
index 3a9a7b8f..6cfd6837 100755
--- a/test/lua-Harness-tests/411-luajit.t
+++ b/test/lua-Harness-tests/411-luajit.t
@@ -37,7 +37,7 @@ if not pcall(io.popen, lua .. [[ -e "a=1"]]) then
     skip_all("io.popen not supported")
 end
 
-local compiled_with_jit = jit.status()
+local compiled_with_jit = jit.opt ~= nil
 local has_jutil = pcall(require, 'jit.util')
 local has_openresty_listing = profile.openresty or jit.version:match'moonjit'
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Tarantool-patches] [PATCH luajit v2 5/5] ci: add nojit flavor for exotic builds
  2023-02-28 19:00 [Tarantool-patches] [PATCH luajit v2 0/5] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches
                   ` (3 preceding siblings ...)
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 4/5] test: fix lua-Harness " Igor Munkin via Tarantool-patches
@ 2023-02-28 19:00 ` Igor Munkin via Tarantool-patches
  2023-03-01 19:30   ` Maxim Kokryashkin via Tarantool-patches
  4 siblings, 1 reply; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-02-28 19:00 UTC (permalink / raw)
  To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches

Since all testing machinery is adjusted for LuaJIT configuration with
disabled compiler support, the new flavor for exotic builds is
introduced in LuaJIT CI.

Part of tarantool/tarantool#8252

Signed-off-by: Igor Munkin <imun@tarantool.org>
---
 .github/workflows/exotic-builds-testing.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/exotic-builds-testing.yml b/.github/workflows/exotic-builds-testing.yml
index 62b83931..870f8238 100644
--- a/.github/workflows/exotic-builds-testing.yml
+++ b/.github/workflows/exotic-builds-testing.yml
@@ -36,7 +36,7 @@ jobs:
         BUILDTYPE: [Debug, Release]
         ARCH: [ARM64, x86_64]
         GC64: [ON, OFF]
-        FLAVOR: [dualnum, checkhook]
+        FLAVOR: [dualnum, checkhook, nojit]
         include:
           - BUILDTYPE: Debug
             CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON
@@ -46,6 +46,8 @@ jobs:
             FLAVORFLAGS: -DLUAJIT_NUMMODE=2
           - FLAVOR: checkhook
             FLAVORFLAGS: -DLUAJIT_ENABLE_CHECKHOOK=ON
+          - FLAVOR: nojit
+            FLAVORFLAGS: -DLUAJIT_DISABLE_JIT=ON
         exclude:
           # DUALNUM is default for ARM64, no need for additional testing.
           - FLAVOR: dualnum
-- 
2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests Igor Munkin via Tarantool-patches
@ 2023-03-01 10:04   ` Sergey Kaplun via Tarantool-patches
  2023-03-02 16:42     ` Igor Munkin via Tarantool-patches
  2023-03-01 19:28   ` Maxim Kokryashkin via Tarantool-patches
  1 sibling, 1 reply; 15+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2023-03-01 10:04 UTC (permalink / raw)
  To: Igor Munkin; +Cc: tarantool-patches

Hi, Igor!
Thanks for the patch!
LGTM, with minnor suggestions below.

On 28.02.23, Igor Munkin wrote:
> This patch adjusts all tests for JIT engine to avoid failures when JIT
> is disabled, so skipcond with the result of <jit.status> as a condition
> is added to handle this.

I see some additional `pcall`-s here for `jit.flush()`, etc..
I suggest the following commit message naming to be consistent with the
next patch ("test: fix lua-Harness JIT-related tests"):
| test: fix tarantool JIT-related tests

> 
> Part of tarantool/tarantool#8252
> 
> Signed-off-by: Igor Munkin <imun@tarantool.org>
> ---
>  test/tarantool-tests/bc-jit-unpatching.test.lua       |  6 ++++--
>  .../fix-fold-simplify-conv-sext.test.lua              |  7 ++++---
>  .../fix-slot-check-for-mm-record.test.lua             |  4 +++-
>  test/tarantool-tests/gh-4199-gc64-fuse.test.lua       |  1 +
>  test/tarantool-tests/gh-4427-ffi-sandwich.test.lua    |  1 +
>  .../gh-4476-fix-string-find-recording.test.lua        |  4 +++-
>  .../gh-5813-resolving-of-c-symbols.test.lua           |  4 +++-
>  .../gh-6065-jit-library-smoke-tests.test.lua          |  4 +++-
>  .../gh-6098-fix-side-exit-patching-on-arm64.test.lua  |  5 ++++-
>  test/tarantool-tests/gh-6189-cur_L.test.lua           |  7 +++++--
>  ...h-6227-bytecode-allocator-for-comparisons.test.lua |  5 ++++-
>  .../gh-6371-string-char-no-arg.test.lua               |  5 +++--
>  .../gh-6782-stitching-in-vmevent-handler.test.lua     |  6 ++++--
>  .../gh-6976-narrowing-of-unary-minus.test.lua         |  5 ++++-
>  .../gh-7264-add-proto-trace-sysprof-default.test.lua  |  1 +
>  test/tarantool-tests/lj-350-sload-typecheck.test.lua  |  8 +++++---
>  .../lj-356-ir-khash-non-string-obj.test.lua           | 11 +++++++----
>  test/tarantool-tests/lj-357-arm64-hrefk.test.lua      |  6 ++++--
>  .../lj-375-ir-bufput-signed-char.test.lua             |  4 +++-
>  .../lj-408-tonumber-cdata-record.test.lua             | 11 ++++++-----
>  test/tarantool-tests/lj-416-xor-before-jcc.test.lua   |  6 ++++--
>  test/tarantool-tests/lj-430-maxirconst.test.lua       |  1 +
>  .../lj-505-fold-no-strref-for-ptrdiff.test.lua        |  4 +++-
>  .../lj-524-fold-conv-respect-src-irt.test.lua         |  6 ++++--
>  .../lj-556-fix-loop-realignment.test.lua              |  4 +++-
>  .../lj-584-bad-renames-for-sunk-values.test.lua       |  4 +++-
>  test/tarantool-tests/lj-603-err-snap-restore.test.lua |  1 +
>  .../lj-672-cdata-allocation-recording.test.lua        |  1 +
>  .../lj-864-varg-rec-base-offset.test.lua              |  6 ++++--
>  test/tarantool-tests/lj-flush-on-trace.test.lua       |  1 +
>  test/tarantool-tests/misclib-getmetrics-capi.test.lua |  1 +
>  test/tarantool-tests/misclib-getmetrics-lapi.test.lua |  1 +
>  test/tarantool-tests/misclib-memprof-lapi.test.lua    |  2 +-
>  test/tarantool-tests/misclib-sysprof-capi.test.lua    |  5 +++--
>  test/tarantool-tests/misclib-sysprof-lapi.test.lua    |  5 +++--
>  35 files changed, 106 insertions(+), 47 deletions(-)
> 
> diff --git a/test/tarantool-tests/bc-jit-unpatching.test.lua b/test/tarantool-tests/bc-jit-unpatching.test.lua
> index 71247f0c..2c3b7c9a 100644
> --- a/test/tarantool-tests/bc-jit-unpatching.test.lua
> +++ b/test/tarantool-tests/bc-jit-unpatching.test.lua

<snipped>

> diff --git a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
> index 07e22c36..60eb3e7c 100644
> --- a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
> +++ b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua

<snipped>

> diff --git a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
> index 8df72ec4..6161747f 100644
> --- a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
> +++ b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
> index 65f9faac..4513d43b 100644
> --- a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
> +++ b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
> index ed3f50d1..86544196 100644
> --- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
> +++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
> index f48af173..0758b38f 100644
> --- a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
> +++ b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
> @@ -1,6 +1,8 @@
>  local tap = require('tap')
> +local test = tap.test("gh-4476-fix-string-find-recording"):skipcond({

Minor: I suggest to use single quotes here according to our code style
for tests. This file is using mixed style, so it will be minor
improvement of the situation.

> +  ['Test requires JIT enabled'] = not jit.status(),
> +})
>  
> -local test = tap.test("gh-4476-fix-string-find-recording")
>  test:plan(1)
>  
>  local err = [[module 'kit.1.10.3-136' not found:
> diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
> index 3c6833fc..9f2c5f85 100644
> --- a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
> +++ b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
> index 7110e351..5d7fd7e2 100644
> --- a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
> +++ b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
> index 4dcf3e22..cfcc6adb 100644
> --- a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
> +++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-6189-cur_L.test.lua b/test/tarantool-tests/gh-6189-cur_L.test.lua
> index 7f2184ec..a5096a7c 100644
> --- a/test/tarantool-tests/gh-6189-cur_L.test.lua
> +++ b/test/tarantool-tests/gh-6189-cur_L.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
> index 9788923a..da399bcf 100644
> --- a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
> +++ b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
> index ec871d19..90121860 100644
> --- a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
> +++ b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
> index 6087e5ae..385e7648 100644
> --- a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
> +++ b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
> index b4792f59..40387cca 100644
> --- a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
> +++ b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua

<snipped>

> diff --git a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
> index 472bc2d1..9cce32cb 100644
> --- a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
> +++ b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-350-sload-typecheck.test.lua b/test/tarantool-tests/lj-350-sload-typecheck.test.lua
> index 33794943..5b25864d 100644
> --- a/test/tarantool-tests/lj-350-sload-typecheck.test.lua
> +++ b/test/tarantool-tests/lj-350-sload-typecheck.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
> index 7f304183..9977205d 100644
> --- a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
> +++ b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
> index 8af9143a..d7e9c85e 100644
> --- a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
> +++ b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
> index 7c8df948..f600d898 100644
> --- a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
> +++ b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
> @@ -1,6 +1,8 @@

<snipped>

> diff --git a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
> index a8235e93..bdd0aaaa 100644
> --- a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
> +++ b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
> index f9a2a869..861114e8 100644
> --- a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
> +++ b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua b/test/tarantool-tests/lj-430-maxirconst.test.lua
> index 633ab676..531acd7d 100644
> --- a/test/tarantool-tests/lj-430-maxirconst.test.lua
> +++ b/test/tarantool-tests/lj-430-maxirconst.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
> index 2866fb12..fec08b30 100644
> --- a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
> +++ b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
> index cd0f0f04..b2ccae63 100644
> --- a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
> +++ b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
> @@ -1,9 +1,11 @@
>  local tap = require('tap')
> -local ffi = require('ffi')
> +local test = tap.test("or-524-fold-icorrect-behavior"):skipcond({

Minor: I suggest to use single quotes here according to our code style
for tests. This file is using mixed style, so it will be minor
improvement of the situation.

> +  ['Test requires JIT enabled'] = not jit.status(),
> +})
>  
> -local test = tap.test("or-524-fold-icorrect-behavior")
>  test:plan(1)
>  
> +local ffi = require('ffi')
>  -- Test file to demonstrate LuaJIT folding machinery incorrect behaviour,
>  -- details:
>  --     https://github.com/LuaJIT/LuaJIT/issues/524
> diff --git a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
> index 6015f55f..b94bd3e9 100644
> --- a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
> +++ b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
> index f037c898..e0c3e577 100644
> --- a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
> +++ b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-603-err-snap-restore.test.lua b/test/tarantool-tests/lj-603-err-snap-restore.test.lua
> index be54a5f3..6eb53dfd 100644
> --- a/test/tarantool-tests/lj-603-err-snap-restore.test.lua
> +++ b/test/tarantool-tests/lj-603-err-snap-restore.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
> index 2165afe3..1d6b19ba 100644
> --- a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
> +++ b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
> index d74c3c2b..d41e33ff 100644
> --- a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
> +++ b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua

<snipped>

> diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua b/test/tarantool-tests/lj-flush-on-trace.test.lua
> index 099e9650..46db4d2a 100644
> --- a/test/tarantool-tests/lj-flush-on-trace.test.lua
> +++ b/test/tarantool-tests/lj-flush-on-trace.test.lua

<snipped>

> diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
> index c5a91955..654e5545 100644
> --- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua
> +++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua

<snipped>

> diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
> index e71bc239..881e717b 100644
> --- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
> +++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua

<snipped>

> diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua
> index 18c8aaab..4e413c88 100644
> --- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
> +++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua

<snipped>

> diff --git a/test/tarantool-tests/misclib-sysprof-capi.test.lua b/test/tarantool-tests/misclib-sysprof-capi.test.lua
> index a9b712a5..5c062195 100644
> --- a/test/tarantool-tests/misclib-sysprof-capi.test.lua
> +++ b/test/tarantool-tests/misclib-sysprof-capi.test.lua

<snipped>

> diff --git a/test/tarantool-tests/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/misclib-sysprof-lapi.test.lua
> index fff89dfd..96eaaab6 100644
> --- a/test/tarantool-tests/misclib-sysprof-lapi.test.lua
> +++ b/test/tarantool-tests/misclib-sysprof-lapi.test.lua

<snipped>

> -- 
> 2.30.2
> 

-- 
Best regards,
Sergey Kaplun

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2 4/5] test: fix lua-Harness JIT-related tests
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 4/5] test: fix lua-Harness " Igor Munkin via Tarantool-patches
@ 2023-03-01 10:08   ` Sergey Kaplun via Tarantool-patches
  2023-03-01 19:30   ` Maxim Kokryashkin via Tarantool-patches
  1 sibling, 0 replies; 15+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2023-03-01 10:08 UTC (permalink / raw)
  To: Igor Munkin; +Cc: tarantool-patches

Hi, Igor!
Thanks for the fixes!
LGTM!

-- 
Best regards,
Sergey Kaplun

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit v2 1/5] Minor fixes.
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 1/5] Minor fixes Igor Munkin via Tarantool-patches
@ 2023-03-01 19:25   ` Maxim Kokryashkin via Tarantool-patches
  0 siblings, 0 replies; 15+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2023-03-01 19:25 UTC (permalink / raw)
  To: Igor Munkin; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]


Hi, Igor!
Thanks for the patch!
LGTM
--
Best regards,
Maxim Kokryashkin
 
 
> 
>>From: Mike Pall <mike>
>>
>>(cherry picked from commit 54484e257f24c47d71b8233844e2ec8664db8071)
>>
>>This is a tiny patch fixing header dependencies for the build with
>>-DLUAJIT_DISABLE_JIT=ON and whitespace inconsistency.
>>
>>Igor Munkin:
>>* added the description
>>
>>Part of tarantool/tarantool#8069
>>
>>Signed-off-by: Igor Munkin < imun@tarantool.org >
>>---
>> src/lib_base.c | 2 +-
>> src/lj_gc.c | 1 +
>> 2 files changed, 2 insertions(+), 1 deletion(-)
>>
>>diff --git a/src/lib_base.c b/src/lib_base.c
>>index 398c4f65..eb6da054 100644
>>--- a/src/lib_base.c
>>+++ b/src/lib_base.c
>>@@ -505,7 +505,7 @@ LJLIB_CF(print)
>>     tv = L->top-1;
>>   }
>>   shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring)
>>- && !gcrefu(basemt_it(G(L), LJ_TNUMX));
>>+ && !gcrefu(basemt_it(G(L), LJ_TNUMX));
>>   for (i = 0; i < nargs; i++) {
>>     cTValue *o = &L->base[i];
>>     const char *str;
>>diff --git a/src/lj_gc.c b/src/lj_gc.c
>>index 29387a48..c306047a 100644
>>--- a/src/lj_gc.c
>>+++ b/src/lj_gc.c
>>@@ -25,6 +25,7 @@
>> #include "lj_cdata.h"
>> #endif
>> #include "lj_trace.h"
>>+#include "lj_dispatch.h"
>> #include "lj_vm.h"
>> 
>> #define GCSTEPSIZE 1024u
>>--
>>2.30.2
> 

[-- Attachment #2: Type: text/html, Size: 2124 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit v2 2/5] build: fix build with JIT disabled
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 2/5] build: fix build with JIT disabled Igor Munkin via Tarantool-patches
@ 2023-03-01 19:27   ` Maxim Kokryashkin via Tarantool-patches
  2023-03-02 15:52     ` Igor Munkin via Tarantool-patches
  0 siblings, 1 reply; 15+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2023-03-01 19:27 UTC (permalink / raw)
  To: Igor Munkin; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 2993 bytes --]


Hi, Igor!
Thanks for the patch!
LGTM, except for a few nits reagrding the commit message.
 
> 
>>struct GCtrace is defined only if LJ_HASJIT is set. Hence, all spots
>Typo: s/struct GCtrace/`struct GCtrace`
>>where GCtrace is used should be also moved under LJ_HASJIT define.
>Typo: s/should be also/should also be
>>
>>Relates to tarantool/tarantool#8252
>>
>>Signed-off-by: Igor Munkin < imun@tarantool.org >
>>---
>> src/lj_memprof.c | 9 ++++-----
>> src/lj_symtab.c | 13 +++----------
>> src/lj_symtab.h | 2 ++
>> 3 files changed, 9 insertions(+), 15 deletions(-)
>>
>>diff --git a/src/lj_memprof.c b/src/lj_memprof.c
>>index d4a639fd..8cab8204 100644
>>--- a/src/lj_memprof.c
>>+++ b/src/lj_memprof.c
>>@@ -369,6 +369,8 @@ void lj_memprof_add_proto(const struct GCproto *pt)
>>   lj_symtab_dump_proto(&mp->out, pt);
>> }
>> 
>>+#if LJ_HASJIT
>>+
>> void lj_memprof_add_trace(const struct GCtrace *tr)
>> {
>>   struct memprof *mp = &memprof;
>>@@ -380,6 +382,8 @@ void lj_memprof_add_trace(const struct GCtrace *tr)
>>   lj_symtab_dump_trace(&mp->out, tr);
>> }
>> 
>>+#endif /* LJ_HASJIT */
>>+
>> #else /* LJ_HASMEMPROF */
>> 
>> int lj_memprof_start(struct lua_State *L, const struct lj_memprof_options *opt)
>>@@ -401,9 +405,4 @@ void lj_memprof_add_proto(const struct GCproto *pt)
>>   UNUSED(pt);
>> }
>> 
>>-void lj_memprof_add_trace(const struct GCtrace *tr)
>>-{
>>- UNUSED(tr);
>>-}
>>-
>> #endif /* LJ_HASMEMPROF */
>>diff --git a/src/lj_symtab.c b/src/lj_symtab.c
>>index 91ee9a72..54984c05 100644
>>--- a/src/lj_symtab.c
>>+++ b/src/lj_symtab.c
>>@@ -53,16 +53,7 @@ void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace)
>>   lj_wbuf_addu64(out, (uint64_t)lineno);
>> }
>> 
>>-#else
>>-
>>-static void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace)
>>-{
>>- UNUSED(out);
>>- UNUSED(trace);
>>- lua_assert(0);
>>-}
>>-
>>-#endif
>>+#endif /* LJ_HASJIT */
>> 
>> void lj_symtab_dump_proto(struct lj_wbuf *out, const GCproto *pt)
>> {
>>@@ -491,11 +482,13 @@ void lj_symtab_dump(struct lj_wbuf *out, const struct global_State *g,
>>       lj_symtab_dump_proto(out, pt);
>>       break;
>>     }
>>+#if LJ_HASJIT
>>     case (~LJ_TTRACE): {
>>       lj_wbuf_addbyte(out, SYMTAB_TRACE);
>>       lj_symtab_dump_trace(out, gco2trace(o));
>>       break;
>>     }
>>+#endif /* LJ_HASJIT */
>>     default:
>>       break;
>>     }
>>diff --git a/src/lj_symtab.h b/src/lj_symtab.h
>>index 6faa5cb1..6ec0cd7c 100644
>>--- a/src/lj_symtab.h
>>+++ b/src/lj_symtab.h
>>@@ -60,10 +60,12 @@
>> #define SYMTAB_TRACE ((uint8_t)2)
>> #define SYMTAB_FINAL ((uint8_t)0x80)
>> 
>>+#if LJ_HASJIT
>> /*
>> ** Dumps traceinfo into the symbol table.
>> */
>> void lj_symtab_dump_trace(struct lj_wbuf *out, const GCtrace *trace);
>>+#endif /* LJ_HASJIT */
>> 
>> /*
>> ** Dumps function prototype.
>>--
>>2.30.2
>--
>Best regards,
>Maxim Kokryashkin
> 

[-- Attachment #2: Type: text/html, Size: 4408 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests Igor Munkin via Tarantool-patches
  2023-03-01 10:04   ` Sergey Kaplun via Tarantool-patches
@ 2023-03-01 19:28   ` Maxim Kokryashkin via Tarantool-patches
  1 sibling, 0 replies; 15+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2023-03-01 19:28 UTC (permalink / raw)
  To: Igor Munkin; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 27464 bytes --]


Hi, Igor!
Thanks for the fixes!
LGTM
--
Best regards,
Maxim Kokryashkin
 
 
> 
>>This patch adjusts all tests for JIT engine to avoid failures when JIT
>>is disabled, so skipcond with the result of <jit.status> as a condition
>>is added to handle this.
>>
>>Part of tarantool/tarantool#8252
>>
>>Signed-off-by: Igor Munkin < imun@tarantool.org >
>>---
>> test/tarantool-tests/bc-jit-unpatching.test.lua | 6 ++++--
>> .../fix-fold-simplify-conv-sext.test.lua | 7 ++++---
>> .../fix-slot-check-for-mm-record.test.lua | 4 +++-
>> test/tarantool-tests/gh-4199-gc64-fuse.test.lua | 1 +
>> test/tarantool-tests/gh-4427-ffi-sandwich.test.lua | 1 +
>> .../gh-4476-fix-string-find-recording.test.lua | 4 +++-
>> .../gh-5813-resolving-of-c-symbols.test.lua | 4 +++-
>> .../gh-6065-jit-library-smoke-tests.test.lua | 4 +++-
>> .../gh-6098-fix-side-exit-patching-on-arm64.test.lua | 5 ++++-
>> test/tarantool-tests/gh-6189-cur_L.test.lua | 7 +++++--
>> ...h-6227-bytecode-allocator-for-comparisons.test.lua | 5 ++++-
>> .../gh-6371-string-char-no-arg.test.lua | 5 +++--
>> .../gh-6782-stitching-in-vmevent-handler.test.lua | 6 ++++--
>> .../gh-6976-narrowing-of-unary-minus.test.lua | 5 ++++-
>> .../gh-7264-add-proto-trace-sysprof-default.test.lua | 1 +
>> test/tarantool-tests/lj-350-sload-typecheck.test.lua | 8 +++++---
>> .../lj-356-ir-khash-non-string-obj.test.lua | 11 +++++++----
>> test/tarantool-tests/lj-357-arm64-hrefk.test.lua | 6 ++++--
>> .../lj-375-ir-bufput-signed-char.test.lua | 4 +++-
>> .../lj-408-tonumber-cdata-record.test.lua | 11 ++++++-----
>> test/tarantool-tests/lj-416-xor-before-jcc.test.lua | 6 ++++--
>> test/tarantool-tests/lj-430-maxirconst.test.lua | 1 +
>> .../lj-505-fold-no-strref-for-ptrdiff.test.lua | 4 +++-
>> .../lj-524-fold-conv-respect-src-irt.test.lua | 6 ++++--
>> .../lj-556-fix-loop-realignment.test.lua | 4 +++-
>> .../lj-584-bad-renames-for-sunk-values.test.lua | 4 +++-
>> test/tarantool-tests/lj-603-err-snap-restore.test.lua | 1 +
>> .../lj-672-cdata-allocation-recording.test.lua | 1 +
>> .../lj-864-varg-rec-base-offset.test.lua | 6 ++++--
>> test/tarantool-tests/lj-flush-on-trace.test.lua | 1 +
>> test/tarantool-tests/misclib-getmetrics-capi.test.lua | 1 +
>> test/tarantool-tests/misclib-getmetrics-lapi.test.lua | 1 +
>> test/tarantool-tests/misclib-memprof-lapi.test.lua | 2 +-
>> test/tarantool-tests/misclib-sysprof-capi.test.lua | 5 +++--
>> test/tarantool-tests/misclib-sysprof-lapi.test.lua | 5 +++--
>> 35 files changed, 106 insertions(+), 47 deletions(-)
>>
>>diff --git a/test/tarantool-tests/bc-jit-unpatching.test.lua b/test/tarantool-tests/bc-jit-unpatching.test.lua
>>index 71247f0c..2c3b7c9a 100644
>>--- a/test/tarantool-tests/bc-jit-unpatching.test.lua
>>+++ b/test/tarantool-tests/bc-jit-unpatching.test.lua
>>@@ -1,9 +1,11 @@
>> local tap = require('tap')
>>-local utils = require('utils')
>>+local test = tap.test('bc-jit-unpatching'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('bc-jit-unpatching')
>> test:plan(1)
>> 
>>+local utils = require('utils')
>> -- Function with up-recursion.
>> local function f(n)
>>   return n < 2 and n or f(n - 1) + f(n - 2)
>>diff --git a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
>>index 07e22c36..60eb3e7c 100644
>>--- a/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
>>+++ b/test/tarantool-tests/fix-fold-simplify-conv-sext.test.lua
>>@@ -1,12 +1,13 @@
>> local tap = require('tap')
>>-local ffi = require('ffi')
>>-
>>-local test = tap.test('fix-fold-simplify-conv-sext')
>>+local test = tap.test('fix-fold-simplify-conv-sext'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>> local NSAMPLES = 4
>> local NTEST = NSAMPLES * 2 - 1
>> test:plan(NTEST)
>> 
>>+local ffi = require('ffi')
>> local samples = ffi.new('int [?]', NSAMPLES)
>> 
>> -- Prepare data.
>>diff --git a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
>>index 8df72ec4..6161747f 100644
>>--- a/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
>>+++ b/test/tarantool-tests/fix-slot-check-for-mm-record.test.lua
>>@@ -1,7 +1,9 @@
>> -- luacheck: globals a0 a1
>> local tap = require('tap')
>>+local test = tap.test('fix-slot-check-for-mm-record'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('fix-slot-check-for-mm-record')
>> test:plan(1)
>> 
>> -- Before the patch, JIT compiler doesn't check slots overflow
>>diff --git a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
>>index 65f9faac..4513d43b 100644
>>--- a/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
>>+++ b/test/tarantool-tests/gh-4199-gc64-fuse.test.lua
>>@@ -1,5 +1,6 @@
>> local tap = require('tap')
>> local test = tap.test('gh-4199-gc64-fuse'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Test requires GC64 mode enabled'] = not require('ffi').abi('gc64'),
>> })
>> 
>>diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
>>index ed3f50d1..86544196 100644
>>--- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
>>+++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua
>>@@ -1,5 +1,6 @@
>> local tap = require('tap')
>> local test = tap.test('gh-4427-ffi-sandwich'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>> })
>> 
>>diff --git a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
>>index f48af173..0758b38f 100644
>>--- a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
>>+++ b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
>>@@ -1,6 +1,8 @@
>> local tap = require('tap')
>>+local test = tap.test("gh-4476-fix-string-find-recording"):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test("gh-4476-fix-string-find-recording")
>> test:plan(1)
>> 
>> local err = [[module 'kit.1.10.3-136' not found:
>>diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
>>index 3c6833fc..9f2c5f85 100644
>>--- a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
>>+++ b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
>>@@ -8,7 +8,9 @@ local test = tap.test("gh-5813-resolving-of-c-symbols"):skipcond({
>> test:plan(5)
>> 
>> jit.off()
>>-jit.flush()
>>+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
>>+-- thrown when LuaJIT is compiled with JIT engine disabled.
>>+pcall(jit.flush)
>> 
>> local bufread = require "utils.bufread"
>> local symtab = require "utils.symtab"
>>diff --git a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
>>index 7110e351..5d7fd7e2 100644
>>--- a/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
>>+++ b/test/tarantool-tests/gh-6065-jit-library-smoke-tests.test.lua
>>@@ -1,6 +1,8 @@
>> local tap = require('tap')
>>+local test = tap.test('gh-6065-jit-library-smoke-tests'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('gh-6065-jit-library-smoke-tests')
>> test:plan(1)
>> 
>> -- Just check whether LuaJIT is built with JIT support. Otherwise,
>>diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
>>index 4dcf3e22..cfcc6adb 100644
>>--- a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
>>+++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64.test.lua
>>@@ -1,5 +1,8 @@
>> local tap = require('tap')
>>-local test = tap.test('gh-6098-fix-side-exit-patching-on-arm64')
>>+local test = tap.test('gh-6098-fix-side-exit-patching-on-arm64'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>>+
>> test:plan(1)
>> 
>> -- The function to be tested for side exit patching:
>>diff --git a/test/tarantool-tests/gh-6189-cur_L.test.lua b/test/tarantool-tests/gh-6189-cur_L.test.lua
>>index 7f2184ec..a5096a7c 100644
>>--- a/test/tarantool-tests/gh-6189-cur_L.test.lua
>>+++ b/test/tarantool-tests/gh-6189-cur_L.test.lua
>>@@ -1,9 +1,12 @@
>>-local libcur_L = require('libcur_L')
>> local tap = require('tap')
>>+local test = tap.test('gh-6189-cur_L'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('gh-6189-cur_L')
>> test:plan(1)
>> 
>>+local libcur_L = require('libcur_L')
>>+
>> local function cbool(cond)
>>   if cond then
>>     return 1
>>diff --git a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
>>index 9788923a..da399bcf 100644
>>--- a/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
>>+++ b/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua
>>@@ -1,5 +1,8 @@
>> local tap = require('tap')
>>-local test = tap.test('gh-6227-bytecode-allocator-for-comparisons')
>>+local test = tap.test('gh-6227-bytecode-allocator-for-comparisons'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>>+
>> test:plan(1)
>> 
>> -- Test file to demonstrate assertion failure during recording
>>diff --git a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
>>index ec871d19..90121860 100644
>>--- a/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
>>+++ b/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua
>>@@ -1,10 +1,11 @@
>> local tap = require('tap')
>>-
>> -- Test file to demonstrate assertion after `string.char()`
>> -- recording.
>> -- See also,  https://github.com/tarantool/tarantool/issues/6371 .
>>+local test = tap.test('gh-6371-string-char-no-arg'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('gh-6371-string-char-no-arg')
>> -- XXX: Number of loop iterations.
>> -- * 1 -- instruction becomes hot.
>> -- * 2 -- recording of the loop body.
>>diff --git a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
>>index 6087e5ae..385e7648 100644
>>--- a/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
>>+++ b/test/tarantool-tests/gh-6782-stitching-in-vmevent-handler.test.lua
>>@@ -1,9 +1,11 @@
>> local tap = require('tap')
>>-
>> -- Test file to demonstrate incorrect stitching behaviour
>> -- in vmevent handler.
>> -- See also  https://github.com/tarantool/tarantool/issues/6782 .
>>-local test = tap.test('gh-6782-stitching-in-vmevent-handler')
>>+local test = tap.test('gh-6782-stitching-in-vmevent-handler'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>>+
>> test:plan(1)
>> 
>> -- Just dump bytecodes is enough.
>>diff --git a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
>>index b4792f59..40387cca 100644
>>--- a/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
>>+++ b/test/tarantool-tests/gh-6976-narrowing-of-unary-minus.test.lua
>>@@ -1,5 +1,8 @@
>> local tap = require('tap')
>>-local test = tap.test('gh-6976-narrowing-of-unary-minus')
>>+local test = tap.test('gh-6976-narrowing-of-unary-minus'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>>+
>> test:plan(2)
>> 
>> jit.opt.start('hotloop=1')
>>diff --git a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
>>index 472bc2d1..9cce32cb 100644
>>--- a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
>>+++ b/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
>>@@ -1,5 +1,6 @@
>> local tap = require('tap')
>> local test = tap.test('gh-7264-add-proto-trace-sysprof-default'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Sysprof is implemented for x86_64 only'] = jit.arch ~= 'x86' and
>>                                                jit.arch ~= 'x64',
>>   ['Sysprof is implemented for Linux only'] = jit.os ~= 'Linux',
>>diff --git a/test/tarantool-tests/lj-350-sload-typecheck.test.lua b/test/tarantool-tests/lj-350-sload-typecheck.test.lua
>>index 33794943..5b25864d 100644
>>--- a/test/tarantool-tests/lj-350-sload-typecheck.test.lua
>>+++ b/test/tarantool-tests/lj-350-sload-typecheck.test.lua
>>@@ -1,13 +1,15 @@
>> local tap = require('tap')
>>-local traceinfo = require('jit.util').traceinfo
>>-
>> -- Test file to demonstrate the incorrect GC64 JIT asembling
>> -- `IR_SLOAD`.
>> -- See also  https://github.com/LuaJIT/LuaJIT/pull/350 .
>>-local test = tap.test('lj-350-sload-typecheck')
>>+local test = tap.test('lj-350-sload-typecheck'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>> test:plan(1)
>> 
>>+local traceinfo = require('jit.util').traceinfo
>>+
>> -- Contains only IR_SLOAD after recording.
>> local function sload(arg)
>>   return arg
>>diff --git a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
>>index 7f304183..9977205d 100644
>>--- a/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
>>+++ b/test/tarantool-tests/lj-356-ir-khash-non-string-obj.test.lua
>>@@ -1,17 +1,20 @@
>> local tap = require('tap')
>>-local traceinfo = require('jit.util').traceinfo
>>-local table_new = require('table.new')
>>-
>> -- Test file to demonstrate the incorrect GC64 JIT behaviour
>> -- of an `IR_HREF` for the on-trace-constant key lookup.
>> -- See also  https://github.com/LuaJIT/LuaJIT/pull/356 .
>>-local test = tap.test('lj-356-ir-khash-non-string-obj')
>>+local test = tap.test('lj-356-ir-khash-non-string-obj'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>>+
>> local N_ITERATIONS = 4
>> 
>> -- Amount of iteration for trace compilation and execution and
>> -- additional check, that there is no new trace compiled.
>> test:plan(N_ITERATIONS + 1)
>> 
>>+local traceinfo = require('jit.util').traceinfo
>>+local table_new = require('table.new')
>>+
>> -- To reproduce the issue we need to compile a trace with
>> -- `IR_HREF`, with a lookup of constant hash key GC value. To
>> -- prevent an `IR_HREFK` to be emitted instead, we need a table
>>diff --git a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
>>index 8af9143a..d7e9c85e 100644
>>--- a/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
>>+++ b/test/tarantool-tests/lj-357-arm64-hrefk.test.lua
>>@@ -1,9 +1,11 @@
>> local tap = require('tap')
>>-
>> -- Test file to demonstrate the incorrect JIT behaviour for HREFK
>> -- IR compilation on arm64.
>> -- See also  https://github.com/LuaJIT/LuaJIT/issues/357 .
>>-local test = tap.test('lj-357-arm64-hrefk')
>>+local test = tap.test('lj-357-arm64-hrefk'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>>+
>> test:plan(2)
>> 
>> jit.opt.start('hotloop=1', 'hotexit=1')
>>diff --git a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
>>index 7c8df948..f600d898 100644
>>--- a/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
>>+++ b/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua
>>@@ -1,6 +1,8 @@
>> local tap = require('tap')
>>+local test = tap.test('lj-375-ir-bufput-signed-char'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('lj-375-ir-bufput-signed-char')
>> -- XXX: Number of loop iterations.
>> -- 1 -- instruction becomes hot
>> -- 2, 3 -- trace is recorded (considering loop recording
>>diff --git a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
>>index a8235e93..bdd0aaaa 100644
>>--- a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
>>+++ b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua
>>@@ -1,18 +1,19 @@
>>-local ffi = require('ffi')
>> local tap = require('tap')
>>-
>> -- Test file to demonstrate the incorrect JIT recording for
>> -- `tonumber()` function with cdata argument for failed
>> -- conversions.
>> -- See also  https://github.com/LuaJIT/LuaJIT/issues/408 ,
>> --  https://github.com/LuaJIT/LuaJIT/pull/412 ,
>> --  https://github.com/tarantool/tarantool/issues/7655 .
>>-local test = tap.test('lj-408-tonumber-cdata-record')
>>-
>>-local NULL = ffi.cast('void *', 0)
>>+local test = tap.test('lj-408-tonumber-cdata-record'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>> test:plan(4)
>> 
>>+local ffi = require('ffi')
>>+local NULL = ffi.cast('void *', 0)
>>+
>> local function check(x)
>>   -- Don't use a tail call to avoid "leaving loop in root trace"
>>   -- error, so the trace will be compiled.
>>diff --git a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
>>index f9a2a869..861114e8 100644
>>--- a/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
>>+++ b/test/tarantool-tests/lj-416-xor-before-jcc.test.lua
>>@@ -1,7 +1,8 @@
>>-local ffi = require('ffi')
>> local tap = require('tap')
>>+local test = tap.test('lj-416-xor-before-jcc'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('lj-416-xor-before-jcc')
>> test:plan(1)
>> 
>> -- To reproduce this issue, we need:
>>@@ -30,6 +31,7 @@ test:plan(1)
>> -- ucomisd and the jnb, thereby causing the jnb to do the wrong
>> -- thing.
>> 
>>+local ffi = require('ffi')
>> ffi.cdef[[
>>   int test_xor_func(int a, int b, int c, int d, int e, int f, void * g, int h);
>> ]]
>>diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua b/test/tarantool-tests/lj-430-maxirconst.test.lua
>>index 633ab676..531acd7d 100644
>>--- a/test/tarantool-tests/lj-430-maxirconst.test.lua
>>+++ b/test/tarantool-tests/lj-430-maxirconst.test.lua
>>@@ -1,5 +1,6 @@
>> local tap = require('tap')
>> local test = tap.test('lj-430-maxirconst'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>> })
>> 
>>diff --git a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
>>index 2866fb12..fec08b30 100644
>>--- a/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
>>+++ b/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua
>>@@ -1,6 +1,8 @@
>> local tap = require('tap')
>>+local test = tap.test("lj-505-fold-icorrect-behavior"):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test("lj-505-fold-icorrect-behavior")
>> test:plan(1)
>> 
>> -- Test file to demonstrate Lua fold machinery icorrect behavior, details:
>>diff --git a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
>>index cd0f0f04..b2ccae63 100644
>>--- a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
>>+++ b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
>>@@ -1,9 +1,11 @@
>> local tap = require('tap')
>>-local ffi = require('ffi')
>>+local test = tap.test("or-524-fold-icorrect-behavior"):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test("or-524-fold-icorrect-behavior")
>> test:plan(1)
>> 
>>+local ffi = require('ffi')
>> -- Test file to demonstrate LuaJIT folding machinery incorrect behaviour,
>> -- details:
>> --  https://github.com/LuaJIT/LuaJIT/issues/524
>>diff --git a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
>>index 6015f55f..b94bd3e9 100644
>>--- a/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
>>+++ b/test/tarantool-tests/lj-556-fix-loop-realignment.test.lua
>>@@ -1,6 +1,8 @@
>> local tap = require('tap')
>>+local test = tap.test('lj-556-fix-loop-realignment'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('lj-556-fix-loop-realignment')
>> test:plan(1)
>> 
>> -- Test file to demonstrate JIT misbehaviour for loop realignment
>>diff --git a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
>>index f037c898..e0c3e577 100644
>>--- a/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
>>+++ b/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua
>>@@ -1,6 +1,8 @@
>> local tap = require('tap')
>>+local test = tap.test('lj-584-bad-renames-for-sunk-values'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>> 
>>-local test = tap.test('lj-584-bad-renames-for-sunk-values')
>> test:plan(1)
>> 
>> -- Test file to demonstrate LuaJIT assembler misbehaviour.
>>diff --git a/test/tarantool-tests/lj-603-err-snap-restore.test.lua b/test/tarantool-tests/lj-603-err-snap-restore.test.lua
>>index be54a5f3..6eb53dfd 100644
>>--- a/test/tarantool-tests/lj-603-err-snap-restore.test.lua
>>+++ b/test/tarantool-tests/lj-603-err-snap-restore.test.lua
>>@@ -40,6 +40,7 @@ recursive_f()
>> test:ok(true)
>> 
>> test:skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>>   -- XXX: The different amount of stack slots is in-use for
>>   -- Tarantool at start, so just skip test for it.
>>diff --git a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
>>index 2165afe3..1d6b19ba 100644
>>--- a/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
>>+++ b/test/tarantool-tests/lj-672-cdata-allocation-recording.test.lua
>>@@ -1,5 +1,6 @@
>> local tap = require('tap')
>> local test = tap.test('lj-672-cdata-allocation-recording'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>> })
>> 
>>diff --git a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
>>index d74c3c2b..d41e33ff 100644
>>--- a/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
>>+++ b/test/tarantool-tests/lj-864-varg-rec-base-offset.test.lua
>>@@ -1,10 +1,12 @@
>> local tap = require('tap')
>>-
>> -- Test file to demonstrate LuaJIT misbehaviour during recording
>> -- BC_VARG with nvarargs >= nresults in GC64 mode.
>> -- See also  https://github.com/LuaJIT/LuaJIT/issues/864 ,
>> --  https://github.com/tarantool/tarantool/issues/7172 .
>>-local test = tap.test('lj-864-varg-rec-base-offset')
>>+local test = tap.test('lj-864-varg-rec-base-offset'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>+})
>>+
>> test:plan(1)
>> 
>> jit.opt.start('hotloop=1')
>>diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua b/test/tarantool-tests/lj-flush-on-trace.test.lua
>>index 099e9650..46db4d2a 100644
>>--- a/test/tarantool-tests/lj-flush-on-trace.test.lua
>>+++ b/test/tarantool-tests/lj-flush-on-trace.test.lua
>>@@ -1,5 +1,6 @@
>> local tap = require('tap')
>> local test = tap.test('lj-flush-on-trace'):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>> })
>> 
>>diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
>>index c5a91955..654e5545 100644
>>--- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua
>>+++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua
>>@@ -1,5 +1,6 @@
>> local tap = require('tap')
>> local test = tap.test("clib-misc-getmetrics"):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>> })
>> 
>>diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
>>index e71bc239..881e717b 100644
>>--- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
>>+++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
>>@@ -4,6 +4,7 @@
>> 
>> local tap = require('tap')
>> local test = tap.test("lib-misc-getmetrics"):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>> })
>> 
>>diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua
>>index 18c8aaab..4e413c88 100644
>>--- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
>>+++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua
>>@@ -1,8 +1,8 @@
>> -- XXX: This comment is a reminder to reimplement memprof tests
>> -- assertions to make them more indepentent to the changes made.
>>--- Now I just leave this 3 lines comment to preserve line numbers.
>> local tap = require("tap")
>> local test = tap.test("misc-memprof-lapi"):skipcond({
>>+ ['Test requires JIT enabled'] = not jit.status(),
>>   ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
>>   ["Memprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
>>                                                jit.arch ~= "x64",
>>diff --git a/test/tarantool-tests/misclib-sysprof-capi.test.lua b/test/tarantool-tests/misclib-sysprof-capi.test.lua
>>index a9b712a5..5c062195 100644
>>--- a/test/tarantool-tests/misclib-sysprof-capi.test.lua
>>+++ b/test/tarantool-tests/misclib-sysprof-capi.test.lua
>>@@ -9,9 +9,10 @@ test:plan(2)
>> 
>> local testsysprof = require("testsysprof")
>> 
>>-local jit = require('jit')
>>-
>> jit.off()
>>+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
>>+-- thrown when LuaJIT is compiled with JIT engine disabled.
>>+pcall(jit.flush)
>> 
>> test:ok(testsysprof.base())
>> test:ok(testsysprof.validation())
>>diff --git a/test/tarantool-tests/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/misclib-sysprof-lapi.test.lua
>>index fff89dfd..96eaaab6 100644
>>--- a/test/tarantool-tests/misclib-sysprof-lapi.test.lua
>>+++ b/test/tarantool-tests/misclib-sysprof-lapi.test.lua
>>@@ -8,7 +8,9 @@ local test = tap.test("misc-sysprof-lapi"):skipcond({
>> test:plan(19)
>> 
>> jit.off()
>>-jit.flush()
>>+-- XXX: Run JIT tuning functions in a safe frame to avoid errors
>>+-- thrown when LuaJIT is compiled with JIT engine disabled.
>>+pcall(jit.flush)
>> 
>> local bufread = require("utils.bufread")
>> local symtab = require("utils.symtab")
>>@@ -127,5 +129,4 @@ check_mode("C", 100)
>> 
>> os.remove(TMP_BINFILE)
>> 
>>-jit.on()
>> os.exit(test:check() and 0 or 1)
>>--
>>2.30.2
> 

[-- Attachment #2: Type: text/html, Size: 31106 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit v2 4/5] test: fix lua-Harness JIT-related tests
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 4/5] test: fix lua-Harness " Igor Munkin via Tarantool-patches
  2023-03-01 10:08   ` Sergey Kaplun via Tarantool-patches
@ 2023-03-01 19:30   ` Maxim Kokryashkin via Tarantool-patches
  1 sibling, 0 replies; 15+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2023-03-01 19:30 UTC (permalink / raw)
  To: Igor Munkin; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 1978 bytes --]


Hi, Igor!
Thanks for the patch!
LGTM
--
Best regards,
Maxim Kokryashkin
 
 
> 
>>lua-Harness considers whether JIT is enabled or not in the scope of the
>>403-jit.t and 411-luajit.t tests. However, the original condition is
>>wrong, since <jit.status> yields false for both cases, when JIT is just
>>turned off and when LuaJIT is built without compiler support. So, if
>><jit.status> yields false, the latter case is considered. The condition
>>is fixed to differ both aforementioned cases in the following way: when
>>jit.opt is nil, LuaJIT is built without compiler; otherwise, JIT support
>>is on board.
>>
>>Part of tarantool/tarantool#8252
>>
>>Signed-off-by: Igor Munkin < imun@tarantool.org >
>>---
>> test/lua-Harness-tests/403-jit.t | 2 +-
>> test/lua-Harness-tests/411-luajit.t | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>>diff --git a/test/lua-Harness-tests/403-jit.t b/test/lua-Harness-tests/403-jit.t
>>index 0f986da9..1a88564b 100755
>>--- a/test/lua-Harness-tests/403-jit.t
>>+++ b/test/lua-Harness-tests/403-jit.t
>>@@ -31,7 +31,7 @@ if not jit then
>>     skip_all("only with LuaJIT")
>> end
>> 
>>-local compiled_with_jit = jit.status()
>>+local compiled_with_jit = jit.opt ~= nil
>> local luajit20 = jit.version_num < 20100 and not jit.version:match'RaptorJIT'
>> local has_jit_opt = compiled_with_jit
>> local has_jit_security = jit.security
>>diff --git a/test/lua-Harness-tests/411-luajit.t b/test/lua-Harness-tests/411-luajit.t
>>index 3a9a7b8f..6cfd6837 100755
>>--- a/test/lua-Harness-tests/411-luajit.t
>>+++ b/test/lua-Harness-tests/411-luajit.t
>>@@ -37,7 +37,7 @@ if not pcall(io.popen, lua .. [[ -e "a=1"]]) then
>>     skip_all("io.popen not supported")
>> end
>> 
>>-local compiled_with_jit = jit.status()
>>+local compiled_with_jit = jit.opt ~= nil
>> local has_jutil = pcall(require, 'jit.util')
>> local has_openresty_listing = profile.openresty or jit.version:match'moonjit'
>> 
>>--
>>2.30.2
> 

[-- Attachment #2: Type: text/html, Size: 2712 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit v2 5/5] ci: add nojit flavor for exotic builds
  2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 5/5] ci: add nojit flavor for exotic builds Igor Munkin via Tarantool-patches
@ 2023-03-01 19:30   ` Maxim Kokryashkin via Tarantool-patches
  0 siblings, 0 replies; 15+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2023-03-01 19:30 UTC (permalink / raw)
  To: Igor Munkin; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]


Hi, Igor!
Thanks for the patch!
LGTM
--
Best regards,
Maxim Kokryashkin
 
 
> 
>>Since all testing machinery is adjusted for LuaJIT configuration with
>>disabled compiler support, the new flavor for exotic builds is
>>introduced in LuaJIT CI.
>>
>>Part of tarantool/tarantool#8252
>>
>>Signed-off-by: Igor Munkin < imun@tarantool.org >
>>---
>> .github/workflows/exotic-builds-testing.yml | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>>diff --git a/.github/workflows/exotic-builds-testing.yml b/.github/workflows/exotic-builds-testing.yml
>>index 62b83931..870f8238 100644
>>--- a/.github/workflows/exotic-builds-testing.yml
>>+++ b/.github/workflows/exotic-builds-testing.yml
>>@@ -36,7 +36,7 @@ jobs:
>>         BUILDTYPE: [Debug, Release]
>>         ARCH: [ARM64, x86_64]
>>         GC64: [ON, OFF]
>>- FLAVOR: [dualnum, checkhook]
>>+ FLAVOR: [dualnum, checkhook, nojit]
>>         include:
>>           - BUILDTYPE: Debug
>>             CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON
>>@@ -46,6 +46,8 @@ jobs:
>>             FLAVORFLAGS: -DLUAJIT_NUMMODE=2
>>           - FLAVOR: checkhook
>>             FLAVORFLAGS: -DLUAJIT_ENABLE_CHECKHOOK=ON
>>+ - FLAVOR: nojit
>>+ FLAVORFLAGS: -DLUAJIT_DISABLE_JIT=ON
>>         exclude:
>>           # DUALNUM is default for ARM64, no need for additional testing.
>>           - FLAVOR: dualnum
>>--
>>2.30.2
> 

[-- Attachment #2: Type: text/html, Size: 2678 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2 2/5] build: fix build with JIT disabled
  2023-03-01 19:27   ` Maxim Kokryashkin via Tarantool-patches
@ 2023-03-02 15:52     ` Igor Munkin via Tarantool-patches
  0 siblings, 0 replies; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-03-02 15:52 UTC (permalink / raw)
  To: Maxim Kokryashkin; +Cc: tarantool-patches

Max,

Thanks for your review!

On 01.03.23, Maxim Kokryashkin wrote:
> 
> Hi, Igor!
> Thanks for the patch!
> LGTM, except for a few nits reagrding the commit message.
>  
> > 
> >>struct GCtrace is defined only if LJ_HASJIT is set. Hence, all spots
> >Typo: s/struct GCtrace/`struct GCtrace`

I can't remember whether I used this syntax in my commit messages.
Furthermore, there is no strict rules in our guidelines regarding code
references. Ignoring.

> >>where GCtrace is used should be also moved under LJ_HASJIT define.
> >Typo: s/should be also/should also be

Fixed.

> >>
> >>Relates to tarantool/tarantool#8252
> >>
> >>Signed-off-by: Igor Munkin < imun@tarantool.org >

<snipped>

> >--
> >Best regards,
> >Maxim Kokryashkin
> > 

-- 
Best regards,
IM

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests
  2023-03-01 10:04   ` Sergey Kaplun via Tarantool-patches
@ 2023-03-02 16:42     ` Igor Munkin via Tarantool-patches
  0 siblings, 0 replies; 15+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2023-03-02 16:42 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: tarantool-patches

Sergey,

Thanks for your review! See my replies below.

On 01.03.23, Sergey Kaplun wrote:
> Hi, Igor!
> Thanks for the patch!
> LGTM, with minnor suggestions below.
> 
> On 28.02.23, Igor Munkin wrote:
> > This patch adjusts all tests for JIT engine to avoid failures when JIT
> > is disabled, so skipcond with the result of <jit.status> as a condition
> > is added to handle this.
> 
> I see some additional `pcall`-s here for `jit.flush()`, etc..
> I suggest the following commit message naming to be consistent with the
> next patch ("test: fix lua-Harness JIT-related tests"):
> | test: fix tarantool JIT-related tests

OK, here is the new commit message:
| test: adjust JIT-related tests in tarantool-tests
|
| This patch adjusts all tests for JIT engine to avoid failures when JIT
| is disabled, so skipcond with the result of <jit.status> as a condition
| is added to handle this.
|
| Furthermore, all tests explicitly that explicitly disable JIT for its
| purpose, are also adjusted by wrapping <jit.flush> calls with <pcall>.
|
| Part of tarantool/tarantool#8252

> 
> > 
> > Part of tarantool/tarantool#8252
> > 
> > Signed-off-by: Igor Munkin <imun@tarantool.org>
> > ---
> >  test/tarantool-tests/bc-jit-unpatching.test.lua       |  6 ++++--
> >  .../fix-fold-simplify-conv-sext.test.lua              |  7 ++++---
> >  .../fix-slot-check-for-mm-record.test.lua             |  4 +++-
> >  test/tarantool-tests/gh-4199-gc64-fuse.test.lua       |  1 +
> >  test/tarantool-tests/gh-4427-ffi-sandwich.test.lua    |  1 +
> >  .../gh-4476-fix-string-find-recording.test.lua        |  4 +++-
> >  .../gh-5813-resolving-of-c-symbols.test.lua           |  4 +++-
> >  .../gh-6065-jit-library-smoke-tests.test.lua          |  4 +++-
> >  .../gh-6098-fix-side-exit-patching-on-arm64.test.lua  |  5 ++++-
> >  test/tarantool-tests/gh-6189-cur_L.test.lua           |  7 +++++--
> >  ...h-6227-bytecode-allocator-for-comparisons.test.lua |  5 ++++-
> >  .../gh-6371-string-char-no-arg.test.lua               |  5 +++--
> >  .../gh-6782-stitching-in-vmevent-handler.test.lua     |  6 ++++--
> >  .../gh-6976-narrowing-of-unary-minus.test.lua         |  5 ++++-
> >  .../gh-7264-add-proto-trace-sysprof-default.test.lua  |  1 +
> >  test/tarantool-tests/lj-350-sload-typecheck.test.lua  |  8 +++++---
> >  .../lj-356-ir-khash-non-string-obj.test.lua           | 11 +++++++----
> >  test/tarantool-tests/lj-357-arm64-hrefk.test.lua      |  6 ++++--
> >  .../lj-375-ir-bufput-signed-char.test.lua             |  4 +++-
> >  .../lj-408-tonumber-cdata-record.test.lua             | 11 ++++++-----
> >  test/tarantool-tests/lj-416-xor-before-jcc.test.lua   |  6 ++++--
> >  test/tarantool-tests/lj-430-maxirconst.test.lua       |  1 +
> >  .../lj-505-fold-no-strref-for-ptrdiff.test.lua        |  4 +++-
> >  .../lj-524-fold-conv-respect-src-irt.test.lua         |  6 ++++--
> >  .../lj-556-fix-loop-realignment.test.lua              |  4 +++-
> >  .../lj-584-bad-renames-for-sunk-values.test.lua       |  4 +++-
> >  test/tarantool-tests/lj-603-err-snap-restore.test.lua |  1 +
> >  .../lj-672-cdata-allocation-recording.test.lua        |  1 +
> >  .../lj-864-varg-rec-base-offset.test.lua              |  6 ++++--
> >  test/tarantool-tests/lj-flush-on-trace.test.lua       |  1 +
> >  test/tarantool-tests/misclib-getmetrics-capi.test.lua |  1 +
> >  test/tarantool-tests/misclib-getmetrics-lapi.test.lua |  1 +
> >  test/tarantool-tests/misclib-memprof-lapi.test.lua    |  2 +-
> >  test/tarantool-tests/misclib-sysprof-capi.test.lua    |  5 +++--
> >  test/tarantool-tests/misclib-sysprof-lapi.test.lua    |  5 +++--
> >  35 files changed, 106 insertions(+), 47 deletions(-)
> > 

<snipped>

> > diff --git a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
> > index f48af173..0758b38f 100644
> > --- a/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
> > +++ b/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua
> > @@ -1,6 +1,8 @@
> >  local tap = require('tap')
> > +local test = tap.test("gh-4476-fix-string-find-recording"):skipcond({
> 
> Minor: I suggest to use single quotes here according to our code style
> for tests. This file is using mixed style, so it will be minor
> improvement of the situation.

Fixed.

> 
> > +  ['Test requires JIT enabled'] = not jit.status(),
> > +})
> >  
> > -local test = tap.test("gh-4476-fix-string-find-recording")

<snipped>

> > diff --git a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
> > index cd0f0f04..b2ccae63 100644
> > --- a/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
> > +++ b/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua
> > @@ -1,9 +1,11 @@
> >  local tap = require('tap')
> > -local ffi = require('ffi')
> > +local test = tap.test("or-524-fold-icorrect-behavior"):skipcond({
> 
> Minor: I suggest to use single quotes here according to our code style
> for tests. This file is using mixed style, so it will be minor
> improvement of the situation.

Fixed.

> 
> > +  ['Test requires JIT enabled'] = not jit.status(),
> > +})
> >  
> > -local test = tap.test("or-524-fold-icorrect-behavior")

<snipped>

> > -- 
> > 2.30.2
> > 
> 
> -- 
> Best regards,
> Sergey Kaplun

-- 
Best regards,
IM

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-03-02 16:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 19:00 [Tarantool-patches] [PATCH luajit v2 0/5] Adjust tests to be run when JIT is disabled Igor Munkin via Tarantool-patches
2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 1/5] Minor fixes Igor Munkin via Tarantool-patches
2023-03-01 19:25   ` Maxim Kokryashkin via Tarantool-patches
2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 2/5] build: fix build with JIT disabled Igor Munkin via Tarantool-patches
2023-03-01 19:27   ` Maxim Kokryashkin via Tarantool-patches
2023-03-02 15:52     ` Igor Munkin via Tarantool-patches
2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 3/5] test: add skipcond for all JIT-related tests Igor Munkin via Tarantool-patches
2023-03-01 10:04   ` Sergey Kaplun via Tarantool-patches
2023-03-02 16:42     ` Igor Munkin via Tarantool-patches
2023-03-01 19:28   ` Maxim Kokryashkin via Tarantool-patches
2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 4/5] test: fix lua-Harness " Igor Munkin via Tarantool-patches
2023-03-01 10:08   ` Sergey Kaplun via Tarantool-patches
2023-03-01 19:30   ` Maxim Kokryashkin via Tarantool-patches
2023-02-28 19:00 ` [Tarantool-patches] [PATCH luajit v2 5/5] ci: add nojit flavor for exotic builds Igor Munkin via Tarantool-patches
2023-03-01 19:30   ` Maxim Kokryashkin via Tarantool-patches

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