Files
Nim/tests/threads/tthreadheapviolation1.nim
Adam Strzelecki e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00

21 lines
372 B
Nim

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)