Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Feb 7, 2023
1 parent df5d78c commit d4ba909
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tools/cases_generator/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,20 +503,20 @@ def test_register():

def test_cond_effect():
input = """
inst(OP, (aa, input if (oparg & 1), cc -- xx, output if (oparg & 2), zz)) {
inst(OP, (aa, input if ((oparg & 1) == 1), cc -- xx, output if (oparg & 2), zz)) {
output = spam(oparg, input);
}
"""
output = """
TARGET(OP) {
PyObject *cc = PEEK(1);
PyObject *input = (oparg & 1) ? PEEK(1 + ((oparg & 1) ? 1 : 0)) : NULL;
PyObject *aa = PEEK(2 + ((oparg & 1) ? 1 : 0));
PyObject *input = ((oparg & 1) == 1) ? PEEK(1 + (((oparg & 1) == 1) ? 1 : 0)) : NULL;
PyObject *aa = PEEK(2 + (((oparg & 1) == 1) ? 1 : 0));
PyObject *xx;
PyObject *output = NULL;
PyObject *zz;
output = spam(oparg, input);
STACK_SHRINK(((oparg & 1) ? 1 : 0));
STACK_SHRINK((((oparg & 1) == 1) ? 1 : 0));
STACK_GROW(((oparg & 2) ? 1 : 0));
POKE(1, zz);
if (oparg & 2) { POKE(1 + ((oparg & 2) ? 1 : 0), output); }
Expand Down

0 comments on commit d4ba909

Please sign in to comment.