destructors: optimize more assignments into moves; also fixes #9294

This commit is contained in:
Andreas Rumpf 2018-10-12 20:36:42 +02:00
commit fcca59e415
5 changed files with 143 additions and 9 deletions

View file

@ -1,6 +1,7 @@
discard """
output: '''after 3 3
after 3 3
output: '''after 2 2
after 2 2
after 2 2
after 2 2'''
"""
# bug #9263
@ -107,6 +108,11 @@ proc test3 =
# a = a - b
b = -b + a
proc test4 =
# bug #9294
var a = matrix(5, 5, 1.0)
a = -a + a
test1()
info()
@ -115,3 +121,6 @@ info()
test3()
info()
test4()
info()