Skip to content

Commit

Permalink
test: skip <string/dump.lua> test for table bump
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Sergey Bronnikov <[email protected]>
Signed-off-by: Sergey Kaplun <[email protected]>
(cherry picked from commit 5daf61c)
  • Loading branch information
Buristan committed Dec 12, 2024
1 parent 7adae6d commit 471522b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test/LuaJIT-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string/dump.lua> 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 <LuaJIT-tests-deps>
Expand Down
2 changes: 1 addition & 1 deletion test/LuaJIT-tests/lib/string/dump.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 471522b

Please sign in to comment.