summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-06-26 15:33:26 +0200
committerAraq <rumpf_a@web.de>2019-06-26 15:33:51 +0200
commit0a81b038fd8b75d9d0e29a6b50567897583031ba (patch)
treef544043d2dc9de1f6ef8d7cfa72d4fb0b2077a9b /tests/destructor
parent993b3909a83a2ebf3f435fee66dcb785daeaf929 (diff)
downloadNim-0a81b038fd8b75d9d0e29a6b50567897583031ba.tar.gz
fixes #11577
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tv2_raise.nim17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/destructor/tv2_raise.nim b/tests/destructor/tv2_raise.nim
index f8d6d30b5..5795c08a0 100644
--- a/tests/destructor/tv2_raise.nim
+++ b/tests/destructor/tv2_raise.nim
@@ -1,7 +1,7 @@
 discard """
   cmd: '''nim c --newruntime $file'''
-  output: '''OK 2
-4 1'''
+  output: '''OK 3
+5 1'''
 """
 
 import strutils, math
@@ -36,6 +36,19 @@ except ValueError:
 except:
   discard
 
+#  bug #11577
+
+proc newError*: owned(ref Exception) {.noinline.} =
+  new(result)
+
+proc mainC =
+  raise newError()
+
+try:
+  mainC()
+except:
+  inc ok
+
 echo "OK ", ok
 
 let (a, d) = allocCounters()