Skip to content

Commit

Permalink
tests: update topt_refcursors
Browse files Browse the repository at this point in the history
The test changing is somewhat of a regression, but the optimization
applying in this case was not intentional anyhow.
  • Loading branch information
zerbina committed Jul 24, 2024
1 parent a6c3013 commit 1bb2247
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions tests/arc/topt_refcursors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ scope:
def_cursor _10: Node = it
it = _10[].ri
L2:
def_cursor jt: Node = root
def jt: Node
=copy(name jt, arg root)
scope:
while true:
scope:
Expand All @@ -37,12 +38,25 @@ scope:
scope:
goto [L5]
def_cursor _18: Node = jt
def_cursor ri: Node = _18[].ri
def ri: Node
=copy(name ri, arg _18[].ri)
def_cursor _19: Node = jt
def_cursor _20: string = _19[].s
echo(arg type(array[0..0, string]), arg _20) -> [Resume]
jt = ri
echo(arg type(array[0..0, string]), arg _20) -> [L6, L7, Resume]
=sink(name jt, arg ri)
wasMoved(name ri)
goto [L6, L8]
finally (L6):
=destroy(name ri)
continue {L7, L8}
L8:
L5:
goto [L7, L9]
finally (L7):
=destroy(name jt)
continue {L9}
L9:
-- end of expandArc ------------------------'''
"""

Expand All @@ -64,5 +78,3 @@ proc traverse(root: Node) =
jt = ri

traverse(nil)

# XXX: This optimization is not sound

0 comments on commit 1bb2247

Please sign in to comment.