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 235879DB7B3; Mon, 29 Jan 2024 13:58:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 235879DB7B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706525936; bh=+QQ7W+TQWQwKHruFBNf3OeiGpNySryyBl/rhjAvhYw4=; 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=u6+GrwupVYTAkofcLSWDpmOdMOKilrnlb46LNzrwcU9/sA794jQs8b/kUkrUzWVf+ 9C7K2AqCA/yeGKe5qOwB27zJS9lspPxNSDA25/z38jX1+V8L0+53oLUog4rKfFuHZ1 MK3q3j7VT4ra/pvw+E066eUT3kn03IQRCaSXXqE8= 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 C3AE39C203F for ; Mon, 29 Jan 2024 13:49:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C3AE39C203F Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1rUPD6-0000000BQ6r-0DSG; Mon, 29 Jan 2024 13:49:52 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 29 Jan 2024 13:45:19 +0300 Message-ID: <0399f0ad011d742bd3f90777e7e5d9b64f26e6d2.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: 4F1203BC0FB41BD96A58C36AA2E99649B648FE8031739DEAF39E53813A442EB0182A05F538085040A4B8C2B37AB9D0AE33594132A326AF8BB7E9E970D178901EDCA4176470581478DC8D45F6CF1587E7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5259CC434672EE6371C2A783ECEC0211AD4AD6D5ED66289B524E70A05D1297E1BBAC83A81C8FD4AD239742502CCDD46D0D40EB8EAD8F79C666AC83A81C8FD4AD23D82A6BABE6F325ACD2706015D7A263A7C38EE81DF43BD05AC6CDE5D1141D2B1C019A83AB9CD6425EDFC7A38AB316BD18AADA85397B56B0544D39AF4B7F69C5898941B15DA834481FA18204E546F3947CFA486DC37A503D0BF6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F79006375FFD5C25497261569FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE7908E50700D6017E0D32BA5DBAC0009BE395957E7521B51C2330BD67F2E7D9AF1090A508E0FED62991661749BA6B977357AF5085B7B0228D6CD04E86FAF290E2DB606B96278B59C421DD303D21008E29813377AFFFEAFD269176DF2183F8FC7C088D2E8BEBF93D4B068655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CA1D607EB49F9BFEF43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5ED3995B2BD2ACB105002B1117B3ED6965E307D9FC4A2C156219207EC0A953D2C823CB91A9FED034534781492E4B8EEAD2609375A3A81E2DDC79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF03A88D2D4A4BECC2658E3F13D8DB2057FE2DA3517EB3CB5D0323C67F006A9F5685EFCC6ECD4542028FB01E7B8BF01A69BEE8511589DFCA0EB718120DE96C5CC52AF8A4AEB58EC5C6C226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmd9AG1X07oT0UVQYzha7Pw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76923A789A78DB4933933594132A326AF8BB7E9E970D178901EB7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: [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 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_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 -- 2.43.0