Tarantool development patches archive
 help / color / mirror / Atom feed
From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org, imun@tarantool.org,
	skaplun@tarantool.org
Subject: [Tarantool-patches] [PATCH luajit 4/4] test: add test for gh-6163 min/max
Date: Thu, 23 Sep 2021 16:55:28 +0300	[thread overview]
Message-ID: <88475d13d1209681b6f811e4028f311f2df0308e.1632404890.git.m.kokryashkin@tarantool.org> (raw)
In-Reply-To: <cover.1632404890.git.m.kokryashkin@tarantool.org>

math.min()/math.max() could produce different results when compiled. The
issue is fixed in vanilla LuaJIT and was backported in 210d511. This
patch adds test case for the mentioned issue.

Closes tarantool/tarantool#6163
---
 .../gh-6163-jit-min-max.test.lua               | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 test/tarantool-tests/gh-6163-jit-min-max.test.lua

diff --git a/test/tarantool-tests/gh-6163-jit-min-max.test.lua b/test/tarantool-tests/gh-6163-jit-min-max.test.lua
new file mode 100644
index 00000000..0e68a2e5
--- /dev/null
+++ b/test/tarantool-tests/gh-6163-jit-min-max.test.lua
@@ -0,0 +1,18 @@
+local tap = require('tap')
+
+local test = tap.test("gh-6163-jit-min-max")
+test:plan(2)
+--
+-- gh-6163: math.min/math.max success with no args
+--
+local pcall = pcall
+
+jit.opt.start(0, 'hotloop=1')
+
+local r, msg = pcall(function() math.min() end)
+test:ok(false == r)
+r, msg = pcall(function() math.min() end)
+test:ok(false == r)
+
+os.exit(test:check() and 0 or 1)
+
-- 
2.33.0


      parent reply	other threads:[~2021-09-23 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 13:54 [Tarantool-patches] [PATCH luajit 0/4] jit: fix math.min/math.max inconsistencies Maxim Kokryashkin via Tarantool-patches
2021-09-23 13:55 ` Maxim Kokryashkin via Tarantool-patches
2021-09-23 13:55 ` [Tarantool-patches] [PATCH luajit 1/4] Fix math.min()/math.max() inconsistencies Maxim Kokryashkin via Tarantool-patches
2021-09-23 13:55 ` [Tarantool-patches] [PATCH luajit 2/4] Don't compile math.modf() anymore Maxim Kokryashkin via Tarantool-patches
2021-09-23 13:55 ` [Tarantool-patches] [PATCH luajit 3/4] Cleanup math function compilation and fix inconsistencies Maxim Kokryashkin via Tarantool-patches
2021-09-23 13:55 ` Maxim Kokryashkin via Tarantool-patches [this message]

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=88475d13d1209681b6f811e4028f311f2df0308e.1632404890.git.m.kokryashkin@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=max.kokryashkin@gmail.com \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 4/4] test: add test for gh-6163 min/max' \
    /path/to/YOUR_REPLY

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

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

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