summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorFanael Linithien <fanael4@gmail.com>2020-11-12 09:28:32 +0100
committerGitHub <noreply@github.com>2020-11-12 09:28:32 +0100
commit7d4f70280ef33192dc5862f8b4c4d23e9d956b40 (patch)
treea0fd7459e3c74170f149854be61d9ca175aeb7a8 /tests
parente5db5316c2101a27efd744ba10126fdb57a7eb7c (diff)
downloadNim-7d4f70280ef33192dc5862f8b4c4d23e9d956b40.tar.gz
Fix #15909 (#15914)
Diffstat (limited to 'tests')
-rw-r--r--tests/arc/t15909.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/arc/t15909.nim b/tests/arc/t15909.nim
new file mode 100644
index 000000000..f25c89daf
--- /dev/null
+++ b/tests/arc/t15909.nim
@@ -0,0 +1,16 @@
+discard """
+  action: run
+  cmd: "nim c --gc:arc $file"
+"""
+
+proc f1() {.noreturn.} = raise newException(CatchableError, "")
+
+proc f2(y: int): int =
+  if y != 0:
+    y
+  else:
+    f1()
+
+doAssert f2(5) == 5
+doAssertRaises(CatchableError):
+  discard f2(0)