summary refs log tree commit diff stats
path: root/tests/destructor/tmatrix.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-10-12 20:36:42 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-12 20:36:42 +0200
commitfcca59e415fe2f3ccbd5c4a977b65305e80f83e8 (patch)
tree29cf2bb8088e0981afa9acce7406aef941c61ccb /tests/destructor/tmatrix.nim
parent2fecf4f36a39049e2d21065929f44dff38cf7d5a (diff)
downloadNim-fcca59e415fe2f3ccbd5c4a977b65305e80f83e8.tar.gz
destructors: optimize more assignments into moves; also fixes #9294
Diffstat (limited to 'tests/destructor/tmatrix.nim')
-rw-r--r--tests/destructor/tmatrix.nim13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/destructor/tmatrix.nim b/tests/destructor/tmatrix.nim
index ba08ec4d6..a16bfa37b 100644
--- a/tests/destructor/tmatrix.nim
+++ b/tests/destructor/tmatrix.nim
@@ -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()