From 7e404c670d5ff55f4316b2ae0a6749161c4bb47d Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 19 Feb 2019 23:32:41 +0100 Subject: gc:destructors: add first test program --- tests/destructor/tgcdestructors.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/destructor/tgcdestructors.nim (limited to 'tests/destructor') 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) -- cgit 1.4.1-2-gfad0