summary refs log tree commit diff stats
path: root/tests/gc/trace_globals.nim
blob: d91bc5f355769e0c9789a548020c67cb733d4073 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
discard """
  output: '''10000000
10000000
10000000'''
"""

# bug #17085

proc init(): string =
  for a in 0..<10000000:
    result.add 'c'

proc f() =
  var a {.global.} = init()
  var b {.global.} = init()
  var c {.global.} = init()

  echo a.len
  echo b.len
  echo c.len

f()