summary refs log tree commit diff stats
path: root/tests/arc/tmovebug.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-02-09 00:22:34 +0100
committerGitHub <noreply@github.com>2020-02-09 00:22:34 +0100
commit240174dd81781e279d84090f1937ebf4b971e29c (patch)
treeff168e604fbdc0b855d6013dc64bbb04c2c69929 /tests/arc/tmovebug.nim
parent038f47e7b93308bef0118e1ef73edf36e39f9b91 (diff)
downloadNim-240174dd81781e279d84090f1937ebf4b971e29c.tar.gz
fixes #13314 (#13372)
Diffstat (limited to 'tests/arc/tmovebug.nim')
-rw-r--r--tests/arc/tmovebug.nim26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/arc/tmovebug.nim b/tests/arc/tmovebug.nim
index 98f181b81..883543877 100644
--- a/tests/arc/tmovebug.nim
+++ b/tests/arc/tmovebug.nim
@@ -1,6 +1,9 @@
 discard """
   cmd: "nim c --gc:arc $file"
-  output: '''5'''
+  output: '''5
+(w: 5)
+(w: -5)
+'''
 """
 
 # move bug
@@ -62,3 +65,24 @@ proc main =
 
 main()
 echo destroyCounter
+
+# bug #13314
+
+type
+  O = object
+    v: int
+  R = ref object
+    w: int
+
+proc `$`(r: R): string = $r[]
+
+proc tbug13314 =
+  var t5 = R(w: 5)
+  var execute = proc () =
+    echo t5
+
+  execute()
+  t5.w = -5
+  execute()
+
+tbug13314()