summary refs log tree commit diff stats
path: root/tests/threads/tthreadheapviolation1.nim
blob: 94e1b64db67211fbf1895b73ebaa995a062c7543 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  line: 11
  errormsg: "'horrible' is not GC-safe"
  cmd: "nim $target --hints:on --threads:on $options $file"
"""

var 
  global: string = "test string"
  t: TThread[void]

proc horrible() {.thread.} =
  global = "string in thread local heap!"
  var x = global
  var mydata = (x, "my string too")
  echo global

createThread[void](t, horrible)
joinThread(t)