summary refs log tree commit diff stats
path: root/tests/arc
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-10-05 16:35:40 +0800
committerGitHub <noreply@github.com>2022-10-05 10:35:40 +0200
commit3e2b30879c31d386b5da0043f6a2604d9c0d7bb4 (patch)
treecec0ff15f38fe6f88c31d2298ff35b94966b8f3c /tests/arc
parent2dec69fe5aa67d4089bf674c25097cc3342b5284 (diff)
downloadNim-3e2b30879c31d386b5da0043f6a2604d9c0d7bb4.tar.gz
fixes #19231; newFinalize doesn't work with ORC (#20291)
* fixes #19231; newFinalize doesn't work with ORC

first make it pass tests

* remove the tables dep

creates a binding for finalized procs in order to handle the same symbols. It used to wrongly generat a new symbol id for the same symbol as the encountered one before

* refactor and revert #14257

* de indentation

* fixes tests; uses instantiated types
Diffstat (limited to 'tests/arc')
-rw-r--r--tests/arc/t19231.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/arc/t19231.nim b/tests/arc/t19231.nim
new file mode 100644
index 000000000..40fcf277c
--- /dev/null
+++ b/tests/arc/t19231.nim
@@ -0,0 +1,18 @@
+discard """
+  matrix: "--mm:orc"
+  targets: "c cpp"
+"""
+
+type
+  Game* = ref object
+
+proc free*(game: Game) =
+  var mixNumOpened:cint = 0
+  for i in 0..<mixNumOpened:
+    mixNumOpened -= 1
+
+proc newGame*(): Game =
+  new result, free
+
+var
+  game*: Game