Skip to content

Commit

Permalink
append
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed Aug 8, 2024
1 parent dc3cfd1 commit 9c4f370
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions pythran/tests/test_optimizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,21 +347,23 @@ def full_unroll0():
for i,j in zip([1,2,3],[4,5,6]): k.append((i,j))
return k"""

ref = '''def full_unroll0():
k = []
__tuple0 = (1, 4)
j = __tuple0[1]
i = __tuple0[0]
builtins.list.append(k, (i, j))
__tuple0 = (2, 5)
j = __tuple0[1]
i = __tuple0[0]
builtins.list.append(k, (i, j))
__tuple0 = (3, 6)
j = __tuple0[1]
i = __tuple0[0]
builtins.list.append(k, (i, j))
return k'''
ref = '''
import __dispatch__ as __pythran_import___dispatch__
def full_unroll0():
k = []
__tuple0 = (1, 4)
j = __tuple0[1]
i = __tuple0[0]
__pythran_import___dispatch__.append(k, (i, j))
__tuple0 = (2, 5)
j = __tuple0[1]
i = __tuple0[0]
__pythran_import___dispatch__.append(k, (i, j))
__tuple0 = (3, 6)
j = __tuple0[1]
i = __tuple0[0]
__pythran_import___dispatch__.append(k, (i, j))
return k'''
self.check_ast(init, ref, ["pythran.optimizations.ConstantFolding", "pythran.optimizations.LoopFullUnrolling"])


Expand Down

0 comments on commit 9c4f370

Please sign in to comment.