mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-106581: Support multiple uops pushing new values (#108895)
Also avoid the need for the awkward .clone() call in the argument to mgr.adjust_inverse() and mgr.adjust().
This commit is contained in:
parent
2c4c26c4ce
commit
b87263be9b
2 changed files with 85 additions and 19 deletions
|
@ -532,6 +532,36 @@ class TestGeneratedCases(unittest.TestCase):
|
|||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_macro_push_push(self):
|
||||
input = """
|
||||
op(A, (-- val1)) {
|
||||
val1 = spam();
|
||||
}
|
||||
op(B, (-- val2)) {
|
||||
val2 = spam();
|
||||
}
|
||||
macro(M) = A + B;
|
||||
"""
|
||||
output = """
|
||||
TARGET(M) {
|
||||
PyObject *val1;
|
||||
PyObject *val2;
|
||||
// A
|
||||
{
|
||||
val1 = spam();
|
||||
}
|
||||
// B
|
||||
{
|
||||
val2 = spam();
|
||||
}
|
||||
STACK_GROW(2);
|
||||
stack_pointer[-2] = val1;
|
||||
stack_pointer[-1] = val2;
|
||||
DISPATCH();
|
||||
}
|
||||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue