From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 94A536E7186; Mon, 20 Nov 2023 15:18:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 94A536E7186 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1700482724; bh=MuHgrf3cyFNyQ34cCizVTzITASGgEsWxNDwcsiNaJPs=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=dowvOw9w8SDhnCYIpkBtNjw076oruGkAhsqqxfYbcqnxUjmks3NJ8/zcEGQQM9r+n 7dU4HPPrkeUVmFLHMBDz1MtKs6U+9NLhJAoND79gj6AQ+SetZQDGnchIkiWQhQHyuR +/1cmPIYubQ5IY2vNy/TlHmjZ7egTe7y0Lt8KuZY= Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [95.163.41.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 534F96E7186 for ; Mon, 20 Nov 2023 15:18:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 534F96E7186 Received: by smtp56.i.mail.ru with esmtpa (envelope-from ) id 1r53Ef-0046rA-1X; Mon, 20 Nov 2023 15:18:42 +0300 Message-ID: Date: Mon, 20 Nov 2023 15:18:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <20231116134456.5898-1-skaplun@tarantool.org> In-Reply-To: <20231116134456.5898-1-skaplun@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD93F1575C7510F5547D25917A9C8A3601FF489A39E1D724A1300894C459B0CD1B92892B6E4F2EE6607FC63349B01020803CEC70B43AA2239CACEE9AC3790D7AB9F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7705F446BE41E38A1EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF05F7050DCA185A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8AADC38879FB7B2EA747295448A461BDE117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAE9A1BBD95851C5BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18E5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE9647ADFADE5905B107FB45A5F6E725C8D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE3632EDEA9CD5989A39735652A29929C6CC4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CD2DCF9CF1F528DBC2E808ACE2090B5E1725E5C173C3A84C317B107DEF921CE79089D37D7C0E48F6C8AA50765F7900637F0A05763E19AB7F2EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A51F125366CDDD3123151173EC91C8040E58D8DE786FBC178DF87CCE6106E1FC07E67D4AC08A07B9B065B78C30F681404DCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF3988A01A71899B02974B8B88CC7440120461BDE018FCE7F20A8F97B4464042129901B20BD73D67EE88AD3775A6B0C8348C5D94C4A3611270290CFC40780427B4E48CAC7CA610320002C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmRIjd71J0y3sb1SjSHB4Ag== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884581AC815159D3CEDDEB9EA35201B02764BB4934413F0E5D243282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30B0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: add test for conversions folding X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hello, Sergey! LGTM On 11/16/23 16:44, Sergey Kaplun wrote: > This patch adds the test for commit > 1a401622fe83ae695226c94df3416e312315d659 ("Fix assertions."). This patch > removes incorrect assertions in the fold optimizations for conversions > from numbers to different integer types. Although the issue affects only > branch 2.0, there is no need to fix it. Nevertheless, the test is > required to avoid regressions in the future. > > Part of tarantool/tarantool#9145 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-833-fold-conv-from-num > Tarantool PR: https://github.com/tarantool/tarantool/pull/9375 > Related issues: > * https://github.com/LuaJIT/LuaJIT/issues/833 > * https://github.com/tarantool/tarantool/issues/9145 > > .../lj-833-fold-conv-from-num.test.lua | 33 +++++++++++++++++++ > 1 file changed, 33 insertions(+) > create mode 100644 test/tarantool-tests/lj-833-fold-conv-from-num.test.lua > > diff --git a/test/tarantool-tests/lj-833-fold-conv-from-num.test.lua b/test/tarantool-tests/lj-833-fold-conv-from-num.test.lua > new file mode 100644 > index 00000000..9e2059bd > --- /dev/null > +++ b/test/tarantool-tests/lj-833-fold-conv-from-num.test.lua > @@ -0,0 +1,33 @@ > +local tap = require('tap') > + > +-- XXX: Test the behaviour of fold optimizations from numbers to > +-- different integer types. The test itself doesn't fail before > +-- the commit since these changes relate only to version 2.0. > + > +local test = tap.test('lj-833-fold-conv-from-num'):skipcond({ > + ['Test requires JIT enabled'] = not jit.status(), > +}) > + > +local ffi = require('ffi') > + > +test:plan(3) > + > +local arr_i64 = ffi.new('int64_t [2]') > +local arr_u64 = ffi.new('uint64_t [2]') > +local arr_u32 = ffi.new('uint32_t [2]') > + > +jit.opt.start('hotloop=1') > + > +for _ = 1, 4 do > + -- Test conversion to type (at store). Also, check the > + -- conversion from number to int64_t at C array indexing. > + arr_i64[1.1] = 1.1 > + arr_u64[1.1] = 1.1 > + arr_u32[1.1] = 1.1 > +end > + > +test:is(arr_i64[1], 1LL, 'correct conversion to int64_t') > +test:is(arr_u64[1], 1ULL, 'correct conversion to uint64_t') > +test:is(arr_u32[1], 1ULL, 'correct conversion to uint32_t') > + > +test:done(true)