summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-04-14 08:45:43 +0200
committerAraq <rumpf_a@web.de>2014-04-14 08:45:43 +0200
commitb961e47bfe519bf456a3e8a0dba3025a3c047b04 (patch)
tree1054a10c42d5c1d0205d14b9ea655218c6be2508 /tests
parent817337af304b8cdf8b96754ae039044840333a02 (diff)
downloadNim-b961e47bfe519bf456a3e8a0dba3025a3c047b04.tar.gz
new concurrency model: first steps; shared is not a keyword anymore
Diffstat (limited to 'tests')
-rw-r--r--tests/typerel/tno_gcmem_in_shared.nim22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/typerel/tno_gcmem_in_shared.nim b/tests/typerel/tno_gcmem_in_shared.nim
new file mode 100644
index 000000000..8c81e8db6
--- /dev/null
+++ b/tests/typerel/tno_gcmem_in_shared.nim
@@ -0,0 +1,22 @@
+discard """
+  errormsg: "shared memory may not refer to GC'ed thread local memory"
+  line: 14
+"""
+
+type
+  Region = object
+  Foo = Region ptr int
+
+  MyObject = object
+    a, b: string
+
+  Bar[T] = shared ptr T
+  Bzar = Bar[MyObject]
+
+proc bar(x: Region ptr int) =
+  discard
+
+var
+  s: Foo
+
+bar s