diff options
author | Clyybber <darkmine956@gmail.com> | 2021-02-09 15:50:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 15:50:52 +0100 |
commit | 9edf719e1e75449c681edaf7a65c0b8691a4ef97 (patch) | |
tree | 68892508fdc8c70a2fa892b740fc91c6ed2b5386 /tests | |
parent | cee58ccf7f7184d72cae415625dbe8016a07d8b8 (diff) | |
download | Nim-9edf719e1e75449c681edaf7a65c0b8691a4ef97.tar.gz |
Revert "ARC Analysis in one pass (#16849)" (#16984)
This reverts commit ab740cb5b9bfbacece26956fa2444763a790ccd1.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arc/tmovebug.nim | 30 | ||||
-rw-r--r-- | tests/arc/topt_no_cursor.nim | 2 |
2 files changed, 3 insertions, 29 deletions
diff --git a/tests/arc/tmovebug.nim b/tests/arc/tmovebug.nim index 888027186..7c8fbc235 100644 --- a/tests/arc/tmovebug.nim +++ b/tests/arc/tmovebug.nim @@ -93,6 +93,7 @@ destroy destroy destroy sink +sink destroy copy (f: 1) @@ -686,7 +687,7 @@ caseNotAConstant() proc potentialSelfAssign(i: var int) = var a: array[2, OO] - a[i] = OO(f: 1) # turned into a memcopy + a[i] = OO(f: 1) a[1] = OO(f: 2) a[i+1] = a[i] # This must not =sink, but =copy inc i @@ -743,30 +744,3 @@ proc partToWholeUnownedRef = partToWholeUnownedRef() - -#-------------------------------------------------------------------- -# test that nodes that get copied during the transformation -# (like dot exprs) don't loose their firstWrite/lastRead property - -type - OOO = object - initialized: bool - - C = object - o: OOO - -proc `=destroy`(o: var OOO) = - doAssert o.initialized, "OOO was destroyed before initialization!" - -proc initO(): OOO = - OOO(initialized: true) - -proc initC(): C = - C(o: initO()) - -proc pair(): tuple[a: C, b: C] = - result.a = initC() # <- when firstWrite tries to find this node to start its analysis it fails, because injectdestructors uses copyTree/shallowCopy - result.b = initC() - -discard pair() - diff --git a/tests/arc/topt_no_cursor.nim b/tests/arc/topt_no_cursor.nim index 6fa19b24a..3d37e6269 100644 --- a/tests/arc/topt_no_cursor.nim +++ b/tests/arc/topt_no_cursor.nim @@ -52,7 +52,7 @@ _ = ( blitTmp, ";") lvalue = _[0] lnext = _[1] -result.value = move lvalue +`=sink`(result.value, move lvalue) `=destroy`(lnext) `=destroy_1`(lvalue) -- end of expandArc ------------------------ |