mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 06:20:38 +00:00
gc:destructors: add first test program
This commit is contained in:
17
tests/destructor/tgcdestructors.nim
Normal file
17
tests/destructor/tgcdestructors.nim
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user