diff options
Diffstat (limited to 'tests/threads/tthreadanalysis.nim')
-rw-r--r--[-rwxr-xr-x] | tests/threads/tthreadanalysis.nim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/threads/tthreadanalysis.nim b/tests/threads/tthreadanalysis.nim index 4edd51025..7fc3593c8 100755..100644 --- a/tests/threads/tthreadanalysis.nim +++ b/tests/threads/tthreadanalysis.nim @@ -1,18 +1,19 @@ discard """ - outputsub: "101" - cmd: "nimrod cc --hints:on --threads:on $# $#" + errormsg: "'threadFunc' is not GC-safe" + line: 38 + cmd: "nim $target --hints:on --threads:on $options $file" """ import os var - thr: array [0..5, TThread[tuple[a, b: int]]] + thr: array[0..5, Thread[tuple[a, b: int]]] -proc doNothing() = nil +proc doNothing() = discard type PNode = ref TNode - TNode = object {.pure.} + TNode {.pure.} = object le, ri: PNode data: string @@ -34,9 +35,9 @@ proc echoLeTree(n: PNode) = echo it.data it = it.le -proc threadFunc(interval: tuple[a, b: int]) {.thread.} = +proc threadFunc(interval: tuple[a, b: int]) {.thread.} = doNothing() - for i in interval.a..interval.b: + for i in interval.a..interval.b: var r = buildTree(i) echoLeTree(r) # for local data echoLeTree(root) # and the same for foreign data :-) |