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 1A00B98C115; Fri, 19 Jan 2024 14:46:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1A00B98C115 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1705664764; bh=Gy7ds52Vt4GnDbS6VC9Ah4Fbr8yJLSeheZuSsPlqNHM=; 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=LhKZTYXZsNRBJOnfo39StGJm2PpMKaJuvBMAuyL7aHiniys373V4Jg1VqUQF4+TkT jpK6ne+QciC/by46H6D5HeyfOW3svRCNgyecBqQY7Vo58sv9WVMckQDHCe9+b2VjmL gNrSlxmNZU9q95wekrUTzk2XiVC7VNNsHtZb+bNs= 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 4CAA7988E40 for ; Fri, 19 Jan 2024 14:37:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4CAA7988E40 Received: by smtp16.i.mail.ru with esmtpa (envelope-from ) id 1rQnBd-00FDC7-1Q; Fri, 19 Jan 2024 14:37:26 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Fri, 19 Jan 2024 14:32:41 +0300 Message-ID: <8140d4775dec4e19bcbc692db304cc04acb4532c.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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9AE5B4AFB3AE2A5902CFE8E94CF0C73AC3A7B46DE77E1D653182A05F5380850405449A3FB27C70A6C77CA480E2D39EF6F005CEF0562BB46486F5E6790906D2F1D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5259CC434672EE6371C2A783ECEC0211AD4AD6D5ED66289B524E70A05D1297E1BBAC83A81C8FD4AD239742502CCDD46D0DC4A366E3182ACBAFAC83A81C8FD4AD23D82A6BABE6F325ACD2706015D7A263A7C38EE81DF43BD05AC6CDE5D1141D2B1CDBAF9D8427FF358A406538A94DFF84956344EFE5383244339FA2833FD35BB23D9E625A9149C048EE1E561CDFBCA1751FF04B652EEC242312D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B292D688DDAD4E7BC389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FC8C7ADC89C2F0B2A5E2021AF6380DFAD18AA50765F7900637F09814068C508CC822CA9DD8327EE4930A3850AC1BE2E73533F64B4C514AF25EC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A56A68AD091820C8563DE3FD803DF40A2FE1025A028F061139F87CCE6106E1FC07E67D4AC08A07B9B067F1C1C3ABB44F3A9C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF423B182689908A2DD1B8F7F722F37E4A90BC7A3FACC901D4903BDA9084195E319EC5AF04A575AA6C6197189FEE4B1C7A3A7B3C3BD49144FC551934FE0023E7EFA74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojJsr4kcGAUCOeYh2xf0JxVw== X-DA7885C5: 3942800A49DF0E7C22358C9D20223E7BD75B06A751122A9D00A22E11D55CBD9CD8288D6B1992AB67EF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE33D6665315E5EBC6A9CFF59B20375439140FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 18/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 changes `dofile()` 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