Skip to content

Commit 1a235d0

Browse files
yoneymeta-codesync[bot]
authored andcommitted
Fix free-threaded list lowering LIR test
Summary: Free-threaded builds use safe runtime calls instead of direct list-slot access. Reviewed By: alexmalyshev Differential Revision: D113913262 fbshipit-source-id: d1c4e01797a0f81b02f3ec5ada2cf8d40be4bd76
1 parent 82cdce4 commit 1a235d0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

cinderx/RuntimeTests/lir_test.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,17 @@ def func(value):
774774
Ref<PyObject> pyfunc(compileAndGet(src, "func"));
775775
ASSERT_NE(pyfunc.get(), nullptr) << "Failed compiling func";
776776

777+
if constexpr (kFreeThreadedBuild) {
778+
auto lir_func = getLIRFunction(pyfunc.get());
779+
EXPECT_LIR(Query(*lir_func)
780+
.opcode(Instruction::kCall)
781+
.inAddr(0, reinterpret_cast<uint64_t>(rt::listSubscript)));
782+
EXPECT_LIR(Query(*lir_func)
783+
.opcode(Instruction::kCall)
784+
.inAddr(0, reinterpret_cast<uint64_t>(PyObject_SetItem)));
785+
return;
786+
}
787+
777788
auto lir_str = getLIRString(pyfunc.get());
778789
const std::regex scaled_array_load{
779790
R"(:Object = Move \[%\d+:\w+ \+ %\d+:\w+ \* 8(?: \+ 0x0)?\]:Object)"};

0 commit comments

Comments
 (0)