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 96E429CBDC2; Mon, 5 Feb 2024 16:10:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 96E429CBDC2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1707138619; bh=/WYHXZKvfFYf/1EMNcrGC+7xZ95BtFhCEl4MVs6zf7Y=; 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=ZzRfxJ6abTG2bTtugzh55GfnA/ooytGTICvv47/ZxhQ8cCf++ROI9YAqX7j+CJ882 OpY8UDJKHHzo+sxBzSuaAIyaZE5We1/4csGhHmfp6IH4s40BG+FrTgm+d3ey6cNzXX s6qEYYP8dv+6N0m7wJEzu0esSkXesu90tcAxN3XM= Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [95.163.41.88]) (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 D98189A88EE for ; Mon, 5 Feb 2024 16:10:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D98189A88EE Received: by smtp52.i.mail.ru with esmtpa (envelope-from ) id 1rWyjp-0000000CAKI-1gvJ; Mon, 05 Feb 2024 16:10:18 +0300 Message-ID: <29eee790-7e0b-44df-aecf-93ffa68110b3@tarantool.org> Date: Mon, 5 Feb 2024 16:10:17 +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: <0399f0ad011d742bd3f90777e7e5d9b64f26e6d2.1706520765.git.skaplun@tarantool.org> In-Reply-To: <0399f0ad011d742bd3f90777e7e5d9b64f26e6d2.1706520765.git.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: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD94C460F083DF69F515295F69A3DCCED9A0936A66FF5CEBD44182A05F53808504019B680A22B7972840578E6996F383413E78F581D4F7DD491434675A7731556E5657EB3FB719050AD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5259CC434672EE6371C2A783ECEC0211AD4AD6D5ED66289B524E70A05D1297E1BBAC83A81C8FD4AD239742502CCDD46D0D684BDE6FB8DA38D9AC83A81C8FD4AD23D82A6BABE6F325ACD2706015D7A263A7C38EE81DF43BD05AC6CDE5D1141D2B1C9D60C771A6F7AB3F80572D8EAAB3C71419222240EE8B9423732E9285B81E4E138941B15DA834481FA18204E546F3947CD2DCF9CF1F528DBCF6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F924B32C592EA89F389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F790063773B5762F265952BDD81D268191BDAD3DBD4B6F7A4D31EC0BE2F48590F00D11D6D81D268191BDAD3D78DA827A17800CE76A867BC78A6EC628EC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5278DA827A17800CE7A03E8F3C2D3812562EB15956EA79C166176DF2183F8FC7C04E672349037D5FA5725E5C173C3A84C3CD42BCEBB57B85E635872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5CD981F728AC7547E5002B1117B3ED6969B5B02EF05ECD1C672305013E4AE841E823CB91A9FED034534781492E4B8EEAD97DCCBFEAAA0BC6ABDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFB9DB132DB38FF2E6698F726F64FB59454293CFCB387B15BE5DE0697D9284690FC9FF4CCC84A62DB714BC176DD269F15E5A5276A2F6C601A15627F4D14714C296CAA733B6D1590E6B5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0TrRSEWQ3VlkdtAjUXsXiA== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769ECEA9348FB27A6F50578E6996F383413E78F581D4F7DD491B7CBEF92542CD7C8795FA72BAB74744FC77752E0C033A69EA16A481184E8BB1C9B38E6EA4F046BE03A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 19/26] 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey thanks for the patch! LGTM On 1/29/24 13:45, Sergey Kaplun wrote: > This patch changes `dofile()` (which uses an unreliable relative file > path and mutates `_G` with global functions to be defined) to the > corresponding `require()` of the helper functions. It adds groups with > the names of subtests and enables the test in . > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/lib/ffi/ffi_parse_basic.lua | 251 +++++++++--------- > test/LuaJIT-tests/lib/ffi/index | 1 + > 2 files changed, 132 insertions(+), 120 deletions(-) > > diff --git a/test/LuaJIT-tests/lib/ffi/ffi_parse_basic.lua b/test/LuaJIT-tests/lib/ffi/ffi_parse_basic.lua > index c054bcfb..3b49648c 100644 > --- a/test/LuaJIT-tests/lib/ffi/ffi_parse_basic.lua > +++ b/test/LuaJIT-tests/lib/ffi/ffi_parse_basic.lua > @@ -1,131 +1,142 @@ > local ffi = require("ffi") > > -dofile("../common/ffi_util.inc") > +local checkfail = require("common.ffi.checkfail") > +local checktypes = require("common.ffi.checktypes") > > -checkfail{ > - "", > - " ", > - "\n", > - "1", > - ".", > - ";", > - ",", > - "*", > - "[]", > - "()", > - "(*)", > - "//", > - "/*", > - "xyz", > - "const", > - "volatile", > - "typedef", > - "extern", > - "static", > - "auto", > - "register", > - "struct", > - "union", > - "sizeof", > - "int int", > - "int char", > - "int double", > - "int;", > -} > +do --- checkfail > + checkfail{ > + "", > + " ", > + "\n", > + "1", > + ".", > + ";", > + ",", > + "*", > + "[]", > + "()", > + "(*)", > + "//", > + "/*", > + "xyz", > + "const", > + "volatile", > + "typedef", > + "extern", > + "static", > + "auto", > + "register", > + "struct", > + "union", > + "sizeof", > + "int int", > + "int char", > + "int double", > + "int;", > + } > +end > > -checktypes{ > - 1, 1, "char", > - 1, 1, " \n\r\t\vchar \n\r\t\v", > - 1, 1, "ch\\\nar", > - 1, 1, "char /* abc */", > - 1, 1, "char /* abc */ const", > - 1, 1, "char // abc\n const", > -} > +do --- char newlines > + checktypes{ > + 1, 1, "char", > + 1, 1, " \n\r\t\vchar \n\r\t\v", > + 1, 1, "ch\\\nar", > + 1, 1, "char /* abc */", > + 1, 1, "char /* abc */ const", > + 1, 1, "char // abc\n const", > + } > +end > > -checktypes{ > - nil, 1, "void", > - 1, 1, "bool", > - 1, 1, "_Bool", > - 4, 4, "_Bool int", > - 1, 1, "char", > - 1, 1, "signed char", > - 1, 1, "unsigned char", > - 2, 2, "short", > - 2, 2, "signed short", > - 2, 2, "unsigned short", > - 4, 4, "int", > - 4, 4, "signed int", > - 4, 4, "unsigned int", > - 4, 4, "signed", > - 4, 4, "unsigned", > - 4, 4, "float", > - 8, 8, "long long", > - 8, 8, "signed long long", > - 8, 8, "unsigned long long", > - 8, 8, "double", > - -- NYI: long double is architecture- and compiler-specific. > - 8, 4, "_Complex float", > - 16, 8, "_Complex", > - 16, 8, "_Complex double", > -} > +do --- base types > + checktypes{ > + nil, 1, "void", > + 1, 1, "bool", > + 1, 1, "_Bool", > + 4, 4, "_Bool int", > + 1, 1, "char", > + 1, 1, "signed char", > + 1, 1, "unsigned char", > + 2, 2, "short", > + 2, 2, "signed short", > + 2, 2, "unsigned short", > + 4, 4, "int", > + 4, 4, "signed int", > + 4, 4, "unsigned int", > + 4, 4, "signed", > + 4, 4, "unsigned", > + 4, 4, "float", > + 8, 8, "long long", > + 8, 8, "signed long long", > + 8, 8, "unsigned long long", > + 8, 8, "double", > + -- NYI: long double is architecture- and compiler-specific. > + 8, 4, "_Complex float", > + 16, 8, "_Complex", > + 16, 8, "_Complex double", > + } > +end > > --- mode/vector_size attributes > -checktypes{ > - 1, 1, "int __attribute__((mode(QI)))", > - 2, 2, "int __attribute__((mode(HI)))", > - 4, 4, "int __attribute__((mode(SI)))", > - 8, 8, "int __attribute__((mode(DI)))", > - 16, 16, "int __attribute__((mode(TI)))", > - 32, 16, "int __attribute__((mode(OI)))", > - 4, 4, "float __attribute__((mode(SF)))", > - 8, 8, "float __attribute__((mode(DF)))", > - 2, 2, "int __attribute__((mode(V2QI)))", > - 16, 16, "float __attribute__((mode(V4SF)))", > - 32, 16, "double __attribute__((mode(V8SF)))", > - 8, 8, "char __attribute__((vector_size(8)))", > - 16, 16, "int __attribute__((vector_size(16)))", > - 32, 16, "double __attribute__((vector_size(32)))", > - 64, 16, "double __attribute__((vector_size(64)))", > -} > +do --- mode/vector_size attributes > + checktypes{ > + 1, 1, "int __attribute__((mode(QI)))", > + 2, 2, "int __attribute__((mode(HI)))", > + 4, 4, "int __attribute__((mode(SI)))", > + 8, 8, "int __attribute__((mode(DI)))", > + 16, 16, "int __attribute__((mode(TI)))", > + 32, 16, "int __attribute__((mode(OI)))", > + 4, 4, "float __attribute__((mode(SF)))", > + 8, 8, "float __attribute__((mode(DF)))", > + 2, 2, "int __attribute__((mode(V2QI)))", > + 16, 16, "float __attribute__((mode(V4SF)))", > + 32, 16, "double __attribute__((mode(V8SF)))", > + 8, 8, "char __attribute__((vector_size(8)))", > + 16, 16, "int __attribute__((vector_size(16)))", > + 32, 16, "double __attribute__((vector_size(32)))", > + 64, 16, "double __attribute__((vector_size(64)))", > + } > +end > > --- ABI-specific types: > -local L = (ffi.abi("32bit") or ffi.abi("win")) and 4 or 8 > -local P = ffi.abi("32bit") and 4 or 8 > -local W = ffi.abi("win") and 2 or 4 > +do --- ABI-specific types: > + local L = (ffi.abi("32bit") or ffi.abi("win")) and 4 or 8 > + local P = ffi.abi("32bit") and 4 or 8 > + local W = ffi.abi("win") and 2 or 4 > > -checktypes{ > - L, L, "long", > - L, L, "signed long", > - L, L, "unsigned long", > - P, P, "int *", > - P, P, "int **", > - 4, 4, "int * __ptr32", > -} > + checktypes{ > + L, L, "long", > + L, L, "signed long", > + L, L, "unsigned long", > + P, P, "int *", > + P, P, "int **", > + 4, 4, "int * __ptr32", > + } > > -checktypes{ > - P, P, "ptrdiff_t", > - P, P, "size_t", > - W, W, "wchar_t", > - 1, 1, "int8_t", > - 2, 2, "int16_t", > - 4, 4, "int32_t", > - 8, 8, "int64_t", > - 1, 1, "uint8_t", > - 2, 2, "uint16_t", > - 4, 4, "uint32_t", > - 8, 8, "uint64_t", > - P, P, "intptr_t", > - P, P, "uintptr_t", > -} > + checktypes{ > + P, P, "ptrdiff_t", > + P, P, "size_t", > + W, W, "wchar_t", > + 1, 1, "int8_t", > + 2, 2, "int16_t", > + 4, 4, "int32_t", > + 8, 8, "int64_t", > + 1, 1, "uint8_t", > + 2, 2, "uint16_t", > + 4, 4, "uint32_t", > + 8, 8, "uint64_t", > + P, P, "intptr_t", > + P, P, "uintptr_t", > + } > +end > > -checktypes{ > - 1, 8, "char __attribute__((aligned(8)))", > - 1, 8, "char __attribute((aligned(8)))", > - 1, 8, "char __attribute__((__aligned__(8)))", > - 1, 8, "__attribute__((aligned(8))) char", > - 1, 8, "char __declspec(align(8))", > - 1, 8, "__declspec(align(8)) char", > - 1, 2, "char __attribute__((aligned(8))) const __attribute__((aligned(2)))", > - 1, 16, "char __attribute__((aligned(8))) const __attribute__((aligned(16)))", > -} > +do --- attributes > + checktypes{ > + 1, 8, "char __attribute__((aligned(8)))", > + 1, 8, "char __attribute((aligned(8)))", > + 1, 8, "char __attribute__((__aligned__(8)))", > + 1, 8, "__attribute__((aligned(8))) char", > + 1, 8, "char __declspec(align(8))", > + 1, 8, "__declspec(align(8)) char", > + 1, 2, "char __attribute__((aligned(8))) const __attribute__((aligned(2)))", > + 1, 16, "char __attribute__((aligned(8))) const __attribute__((aligned(16)))", > + } > +end > > diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index > index 89773c0c..a805bdd0 100644 > --- a/test/LuaJIT-tests/lib/ffi/index > +++ b/test/LuaJIT-tests/lib/ffi/index > @@ -17,6 +17,7 @@ ffi_lex_number.lua > ffi_metatype.lua > ffi_new.lua > ffi_parse_array.lua > +ffi_parse_basic.lua > istype.lua > jit_array.lua > jit_complex.lua