From 471522b3403aa1fd3c27c393fc538faeaa39b835 Mon Sep 17 00:00:00 2001 From: Sergey Kaplun Date: Tue, 3 Dec 2024 12:35:44 +0300 Subject: [PATCH] test: skip test for table bump If the `foo()` function itself starts to be recorded on the very first call, it leads to the changing of TNEW bytecode when table bump optimization is enabled. This patch skips the test for this type of build. Reviewed-by: Maxim Kokryashkin Reviewed-by: Sergey Bronnikov Signed-off-by: Sergey Kaplun (cherry picked from commit 5daf61c7f28c5eb5668f7740021f61dd6e7bfed4) --- test/LuaJIT-tests/CMakeLists.txt | 8 ++++++++ test/LuaJIT-tests/lib/string/dump.lua | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt index d0771e144b..0df3f4ea09 100644 --- a/test/LuaJIT-tests/CMakeLists.txt +++ b/test/LuaJIT-tests/CMakeLists.txt @@ -71,6 +71,14 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") list(APPEND LUAJIT_TEST_TAGS_EXTRA +libc=${LIBC_VERSION}) endif() +if(LUAJIT_ENABLE_TABLE_BUMP) + # Test verifies that the bytecode is unchanged + # for the prototype with the recorded trace. Table bump + # optimization changes the TNEW/TDUP bytecodes, so skip the test + # in that case. + list(APPEND LUAJIT_TEST_TAGS_EXTRA +table_bump) +endif() + set(TEST_SUITE_NAME "LuaJIT-tests") # XXX: The call produces both test and target diff --git a/test/LuaJIT-tests/lib/string/dump.lua b/test/LuaJIT-tests/lib/string/dump.lua index 216c6eb8bf..9c29ac5063 100644 --- a/test/LuaJIT-tests/lib/string/dump.lua +++ b/test/LuaJIT-tests/lib/string/dump.lua @@ -1,6 +1,6 @@ local loadstring = loadstring or load -do --- Must unpatch modified bytecode with ILOOP/JLOOP etc. +do --- Must unpatch modified bytecode with ILOOP/JLOOP etc. -table_bump local function foo() local t = {} for i=1,100 do t[i] = i end