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 C366D9DB78D; Mon, 29 Jan 2024 13:58:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C366D9DB78D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706525905; bh=mZHrRYP6WtpTPRS7KRXuse2ysKAcwOv2a6GQ42Wy4Vs=; 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=qapaboLenx+zWpe+/Op5YpVnCtTin/San8njXqdnO19hVDsilkj2zA91XZ744pFv/ IDo0lAiwUSazaMIqV33gMHuWHeaEygr2bdrjMAtnw8KScm03RU6dA4h2NWHRfN+2kT pAZuSv7towdDqx0gJZTMsZwwhRGiMU9GKr8dJdjo= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 EB0209C203E for ; Mon, 29 Jan 2024 13:49:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EB0209C203E Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1rUPD3-0000000BQ6r-1D1L; Mon, 29 Jan 2024 13:49:49 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 29 Jan 2024 13:45:18 +0300 Message-ID: <2d1cb0d61396fbc7d6efd352ed540079df684477.1706520765.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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD96A58C36AA2E99649B648FE8031739DEAF39E53813A442EB0182A05F53808504029E0200673ED5CA933594132A326AF8BCDFCBFC68BD59AC8DCA41764705814783B74FEA2CA3DCB6F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DBA72CFE7C57007CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CDB0FA248422B0DF8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D81630A0FBCEA6FABABE1BF1E404F07B8E2B8BC6DB13E8184BCC7F00164DA146DAFE8445B8C89999728AA50765F79006375FFD5C25497261569FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3CF36E64A7E3F8E58117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFF4AF32A017141CDEBA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B643F02D679E232DDC76E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C22494854413538E1713FE827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B61F2C8E835678F328089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5E9E7822270B10E3B5002B1117B3ED696908BC0D318BDACF0A9DAB4B68AE4D22F823CB91A9FED034534781492E4B8EEADFF021744A2531FDDF36E2E0160E5C55395B8A2A0B6518DF68C46860778A80D548E8926FB43031F38 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF0B82AE11FE3428B48B91A658F1F2FAC8294D6B8C3861F88498A4FFEDFFC4C7BCCFC48FC8A09AC8558FB01E7B8BF01A69F9B9340D962B709FB718120DE96C5CC56985128435C2B38EC226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmd9AG1X07oRG6WzP+5SNMw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76980A71C5433A5390A33594132A326AF8BCDFCBFC68BD59AC8B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 18/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 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 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_array.lua | 106 ++++++++++-------- test/LuaJIT-tests/lib/ffi/index | 1 + 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua b/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua index 3a9616d7..d3b02759 100644 --- a/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua +++ b/test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua @@ -1,58 +1,66 @@ local ffi = require("ffi") -dofile("../common/ffi_util.inc") +local checkfail = require("common.ffi.checkfail") +local checktypes = require("common.ffi.checktypes") +local fails = require("common.fails") -checkfail{ - "int [", - "int [-1]", - "int [[1]]", - "int [10][]", - "int [10][?]", - "int [][]", - "int [][?]", - "int [?][]", - "int [?][?]", - "int [0x10000][0x2000]", - "int [256][256][256][256]", - "int [10](void)", - "int (void)[10]", - "int &[10]", - "union { double x; int a[?]; }", -} +do --- checkfail + checkfail{ + "int [", + "int [-1]", + "int [[1]]", + "int [10][]", + "int [10][?]", + "int [][]", + "int [][?]", + "int [?][]", + "int [?][?]", + "int [0x10000][0x2000]", + "int [256][256][256][256]", + "int [10](void)", + "int (void)[10]", + "int &[10]", + "union { double x; int a[?]; }", + } +end -ffi.cdef([[ - typedef int foo1_t[10]; - typedef foo1_t foo2_t[5]; -]]) -assert(ffi.sizeof("foo1_t") == 40) -assert(ffi.sizeof("foo2_t") == 200) +do --- sizeof of arrays + ffi.cdef([[ + typedef int foo1_array_t[10]; + typedef foo1_array_t foo2_array_t[5]; + ]]) + assert(ffi.sizeof("foo1_array_t") == 40) + assert(ffi.sizeof("foo2_array_t") == 200) +end -local P = ffi.sizeof("void *") -checktypes{ - 10, 1, "char [10]", - 4*10, 4, "int [10]", - 4*10, 4, "int [10]", - 4*10*5, 4, "int [10][5]", - 4*10*5*3*2*7, 4, "int [10][5][3][2][7]", - 4*10*5, 4, "int ([10])[5]", - P*10, P, "int *[10]", - P, P, "int (*)[10]", - P*5, P, "int (*[5])[10]", - 8*10, 4, "struct { int x; char y; } [10]", - P*5*10, P, "volatile int *(* const *[5][10])(void)", - nil, 4, "int []", - 4*10, 8, "int __attribute__((aligned(8))) [10]", - 4*10, 8, "__attribute__((aligned(8))) int [10]", - 4*10, 8, "int [10] __attribute__((aligned(8)))", - 97, 1, "char ['a']", - 83, 1, "char ['\\123']", - 79, 1, "char ['\x4F']", - 5, 1, "char [sizeof(\"aa\" \"bb\")]", - 80, 8, "double [10]", -} +do --- checktypes + local P = ffi.sizeof("void *") + checktypes{ + 10, 1, "char [10]", + 4*10, 4, "int [10]", + 4*10, 4, "int [10]", + 4*10*5, 4, "int [10][5]", + 4*10*5*3*2*7, 4, "int [10][5][3][2][7]", + 4*10*5, 4, "int ([10])[5]", + P*10, P, "int *[10]", + P, P, "int (*)[10]", + P*5, P, "int (*[5])[10]", + 8*10, 4, "struct { int x; char y; } [10]", + P*5*10, P, "volatile int *(* const *[5][10])(void)", + nil, 4, "int []", + 4*10, 8, "int __attribute__((aligned(8))) [10]", + 4*10, 8, "__attribute__((aligned(8))) int [10]", + 4*10, 8, "int [10] __attribute__((aligned(8)))", + 97, 1, "char ['a']", + 83, 1, "char ['\\123']", + 79, 1, "char ['\x4F']", + 5, 1, "char [sizeof(\"aa\" \"bb\")]", + 80, 8, "double [10]", + } +end -do +do --- sizeof VLA assert(ffi.sizeof("int [?]", 10) == 4*10) local id = ffi.typeof("const short [?]") assert(ffi.sizeof(id, 10) == 2*10) @@ -64,7 +72,7 @@ do assert(ffi.sizeof(id, 0x3fffffff) == 2*0x3fffffff) end -do +do --- sizeof VLS assert(ffi.sizeof("struct { double x; int a[?]; }", 10) == 8+4*10) local id = ffi.typeof("struct { int x; short a[?]; }") assert(ffi.sizeof(id, 10) == 4+2*10) diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index index e6c1fd0f..89773c0c 100644 --- a/test/LuaJIT-tests/lib/ffi/index +++ b/test/LuaJIT-tests/lib/ffi/index @@ -16,6 +16,7 @@ ffi_jit_conv.lua ffi_lex_number.lua ffi_metatype.lua ffi_new.lua +ffi_parse_array.lua istype.lua jit_array.lua jit_complex.lua -- 2.43.0