summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
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