summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tgcdestructors.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/destructor/tgcdestructors.nim b/tests/destructor/tgcdestructors.nim
new file mode 100644
index 000000000..60d7fc14f
--- /dev/null
+++ b/tests/destructor/tgcdestructors.nim
@@ -0,0 +1,17 @@
+discard """
+  cmd: '''nim c --gc:destructors $file'''
+  output: '''1 1'''
+"""
+
+import allocators
+include system / ansi_c
+
+proc main =
+  var s: seq[string] = @[]
+  for i in 0..<80: s.add "foo"
+
+main()
+
+#echo s
+let (a, d) = allocCounters()
+cprintf("%ld %ld\n", a, d)