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.
  • Loading branch information
Buristan committed Dec 3, 2024
1 parent b52fe97 commit b756625
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 @@ -62,6 +62,14 @@ if(CMAKE_C_FLAGS MATCHES "-march=skylake-avx512")
list(APPEND LUAJIT_TEST_TAGS_EXTRA +avx512)
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 b756625

Please sign in to comment.