mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-124285: Fix bug where bool() is called multiple times for the same part of a boolean expression (#124394)
This commit is contained in:
parent
c58c572a65
commit
78aeb38f7d
14 changed files with 234 additions and 47 deletions
|
@ -523,6 +523,36 @@ class TestGeneratedCases(unittest.TestCase):
|
|||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_pseudo_instruction_as_sequence(self):
|
||||
input = """
|
||||
pseudo(OP, (in -- out1, out2)) = [
|
||||
OP1, OP2
|
||||
];
|
||||
|
||||
inst(OP1, (--)) {
|
||||
}
|
||||
|
||||
inst(OP2, (--)) {
|
||||
}
|
||||
"""
|
||||
output = """
|
||||
TARGET(OP1) {
|
||||
frame->instr_ptr = next_instr;
|
||||
next_instr += 1;
|
||||
INSTRUCTION_STATS(OP1);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(OP2) {
|
||||
frame->instr_ptr = next_instr;
|
||||
next_instr += 1;
|
||||
INSTRUCTION_STATS(OP2);
|
||||
DISPATCH();
|
||||
}
|
||||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
|
||||
def test_array_input(self):
|
||||
input = """
|
||||
inst(OP, (below, values[oparg*2], above --)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue