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 EAC83988E60; Fri, 19 Jan 2024 14:43:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EAC83988E60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1705664585; bh=8aBJi/xVX7AM/r4VPdmyotau5HvVyfzlmoDOKuDNhRY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=x4fI7Ni8Wu4usLSxZn5tSAaf+aEnD2V4a1HGwheD6TO+9MLPkECiBMobhB4a/Zii5 5r/wds/E/cIjyuVLWn65/aBB3VYmTrWTBL5XxQN41GAlKLIokjAqz2aYcUxdDXwP39 0F0Ca9+QNL9R5pY5VXhPBJYTtMQPG31oR8N8JpdI= Received: from smtp16.i.mail.ru (smtp16.i.mail.ru [95.163.41.69]) (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 7C0599885F8 for ; Fri, 19 Jan 2024 14:37:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7C0599885F8 Received: by smtp16.i.mail.ru with esmtpa (envelope-from ) id 1rQnBR-00FDC7-2W; Fri, 19 Jan 2024 14:37:14 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Fri, 19 Jan 2024 14:32:35 +0300 Message-ID: <5d4ac76f2273df84a6cfc329e75af0a2ed7b007c.1705661401.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9AE5B4AFB3AE2A5904EC891EEB881DF0AF65B18B424229B5F182A05F53808504087B02EE2DE7B7326CD49626DD364B07C660C0AE34A4DAF52C5ACEF4707CB4302 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DEFE6A28F0C4BE99C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE77EA152918BB9CDE0EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B73AB1701401CD8711DA52C7E779D486EE962180C0E96317CCC7F00164DA146DAFE8445B8C89999728AA50765F7900637BA939FD1B3BAB99B389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8A9FF340AA05FB58CF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD187441229DB5CFFAA63A03B725D353964B2FFDA4F57982C5F435872C767BF85DA227C277FBC8AE2E8B9C5AF73B5E338C8A75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5D347648A56C273263DE3FD803DF40A2F3A6B84EFDB8A853EF87CCE6106E1FC07E67D4AC08A07B9B0251EFD5447B32ED69C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFBA7FE3101ABE6E4F0CCF4C5B8B508B29EDE8B9EC2BAE5E98CECE9948D654F50C1230ACE34F2D113D6197189FEE4B1C7AF9E2AC0CA8A48A6252C05B190331B123A74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojJsr4kcGAUCO4vi3Q9lsOyQ== X-DA7885C5: 62C80D7B6DE7DB0F22358C9D20223E7BE06170E47BE5BD5412E083A63F701F70262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE33D863D497F38A06E5F7B7EFC383F5591D0FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 12/25] test: enable in LuaJIT-tests 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This patch uses the basename of the ctest library to be loaded via FFI. It adds groups with the names of subtests and enables the test in . The corresponding conditions are changed to the tags checked by analogy with other tests. Tests with calls with 10 arguments with sizes less than 8 bits are dummy for M1. This suite lacks a mechanism to skip subtests satisfying complicated conditions, so it is done manually by the corresponding `if` check. Part of tarantool/tarantool#9398 --- test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua | 70 ++++++++++++---------- test/LuaJIT-tests/lib/ffi/index | 1 + 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua b/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua index b79d60b1..4e9a962d 100644 --- a/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua +++ b/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua @@ -35,33 +35,37 @@ double __stdcall stdcall_dd(double a, double b); float __stdcall stdcall_ff(float a, float b); ]] -local lib = ffi.load("../clib/ctest") - -do - local x - for i=1,100 do - x = lib.call_10i(-42, 17, 12345, 9987, -100, 11, 51, 0x12345678, 338, -78901234) +local lib = ffi.load("ctest") + +do --- call_10i + if not (jit.os == "OSX" and jit.arch == "arm64") then -- NYI + local x + for i=1,100 do + x = lib.call_10i(-42, 17, 12345, 9987, -100, 11, 51, 0x12345678, 338, -78901234) + end + assert(x == -42+17+12345+9987-100+11+51+0x12345678+338-78901234) end - assert(x == -42+17+12345+9987-100+11+51+0x12345678+338-78901234) end -do +do --- call_max for i=1,100 do pcall(lib.call_max, i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i) end end -if ffi.abi("64bit") then - local y = ffi.cast("void *", 0x123456789abcdefLL) - local x - for i=1,100 do - lib.call_10j_p(0,0,0,0,0,0,0,0,0, y) - x = lib.call_10j_p(0,0,0,0,0,0,0,0,0, nil) +do --- call_10j_p +abi64 + if not (jit.os == "OSX" and jit.arch == "arm64") then -- NYI + local y = ffi.cast("void *", 0x123456789abcdefLL) + local x + for i=1,100 do + lib.call_10j_p(0,0,0,0,0,0,0,0,0, y) + x = lib.call_10j_p(0,0,0,0,0,0,0,0,0, nil) + end + assert(x == 0) end - assert(x == 0) end -do +do --- call_ij local x = 0 for i=1,100 do x = x + lib.call_ij(100+i, i*0x300000002LL) @@ -69,7 +73,7 @@ do assert(x == 0x3b2e0000623eLL) end -do +do --- call_10d local x for i=1,100 do x = lib.call_10d(-42.5, 17.125, 12345.5, 9987, -100.625, 11, 51, 0x12345678, 338, -78901234.75) @@ -77,15 +81,17 @@ do assert(x == -42.5+17.125+12345.5+9987-100.625+11+51+0x12345678+338-78901234.75) end -do - local x - for i=1,100 do - x = lib.call_10f(-42.5, 17.125, 12345.5, 9987, -100.625, 11, 51, 0x123456, 338, -789012.75) +do --- call_10f + if not (jit.os == "OSX" and jit.arch == "arm64") then -- NYI + local x + for i=1,100 do + x = lib.call_10f(-42.5, 17.125, 12345.5, 9987, -100.625, 11, 51, 0x123456, 338, -789012.75) + end + assert(x == -42.5+17.125+12345.5+9987-100.625+11+51+0x123456+338-789012.75) end - assert(x == -42.5+17.125+12345.5+9987-100.625+11+51+0x123456+338-789012.75) end -do +do --- call_b local x for i=-100,100 do if not lib.call_b(i) then x = i end @@ -100,14 +106,14 @@ do assert(x == 90) end -do +do --- tail call_b local function tail(x) return lib.call_b(x) end for i=1,100 do local a,b,c = tail(1), tail(1), tail(1) end end -do +do --- call i8[_i] u8[_i] i16[_i] u16[_i] local x = 0 for i=0x01010080,0x010100ff do x = x + lib.call_i_i8(i) end assert(x == -8128) @@ -135,7 +141,7 @@ do end -- target-specific -if jit.arch == "x86" then +do --- fastcall +x86 for i=1,100 do assert(lib.fastcall_i(-42) == -41) end for i=1,100 do assert(lib.fastcall_ii(-42, 17) == -42+17) end for i=1,100 do assert(lib.fastcall_iii(-42, 17, 139) == -42+17+139) end @@ -143,12 +149,12 @@ if jit.arch == "x86" then for i=1,100 do assert(lib.fastcall_dd(12.5, -3.25) == 12.5-3.25) end local x = lib.fastcall_ji for i=1,100 do assert(x(0x123456789LL, -17) == 0x123456789LL-17) end +end - if jit.os == "Windows" then - for i=1,100 do assert(lib.stdcall_i(-42) == -41) end - for i=1,100 do assert(lib.stdcall_ii(-42, 17) == -42+17) end - for i=1,100 do assert(lib.stdcall_dd(12.5, -3.25) == 12.5-3.25) end - for i=1,100 do assert(lib.stdcall_ff(12.5, -3.25) == 12.5-3.25) end - end +do --- stdcall +x86 +windows + for i=1,100 do assert(lib.stdcall_i(-42) == -41) end + for i=1,100 do assert(lib.stdcall_ii(-42, 17) == -42+17) end + for i=1,100 do assert(lib.stdcall_dd(12.5, -3.25) == 12.5-3.25) end + for i=1,100 do assert(lib.stdcall_ff(12.5, -3.25) == 12.5-3.25) end end diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index index 0c1e5e66..d6e2b64a 100644 --- a/test/LuaJIT-tests/lib/ffi/index +++ b/test/LuaJIT-tests/lib/ffi/index @@ -11,6 +11,7 @@ ffi_convert.lua ffi_enum.lua ffi_gcstep_recursive.lua ffi_jit_arith.lua +ffi_jit_call.lua istype.lua jit_array.lua jit_complex.lua -- 2.43.0