diff options
author | Mark Shannon <mark@hotpy.org> | 2025-04-14 12:19:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-14 12:19:53 +0100 |
commit | 844596c09fc812a58ac1b381b51bee12d327da31 (patch) | |
tree | 2396230f46529229bba300f1adecf92c4a88deb4 /Lib/test/test_generated_cases.py | |
parent | be763e550e28e740b7b22c3267d14565d126f28d (diff) | |
download | cpython-844596c09fc812a58ac1b381b51bee12d327da31.tar.gz cpython-844596c09fc812a58ac1b381b51bee12d327da31.zip |
GH-131498: Cases generator: Allow input and 'peek' variables to be modified (GH-132506)
Diffstat (limited to 'Lib/test/test_generated_cases.py')
-rw-r--r-- | Lib/test/test_generated_cases.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Lib/test/test_generated_cases.py b/Lib/test/test_generated_cases.py index 302e69de285..5b120f28131 100644 --- a/Lib/test/test_generated_cases.py +++ b/Lib/test/test_generated_cases.py @@ -1862,13 +1862,28 @@ class TestGeneratedCases(unittest.TestCase): def test_reassigning_live_inputs(self): input = """ - inst(OP, (in -- )) { + inst(OP, (in -- in)) { in = 0; - DEAD(in); } """ - with self.assertRaises(SyntaxError): - self.run_cases_test(input, "") + + output = """ + TARGET(OP) { + #if Py_TAIL_CALL_INTERP + int opcode = OP; + (void)(opcode); + #endif + frame->instr_ptr = next_instr; + next_instr += 1; + INSTRUCTION_STATS(OP); + _PyStackRef in; + in = stack_pointer[-1]; + in = 0; + stack_pointer[-1] = in; + DISPATCH(); + } + """ + self.run_cases_test(input, output) def test_reassigning_dead_inputs(self): input = """ |