summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorVarriount <Varriount@users.noreply.github.com>2014-04-23 19:47:03 -0400
committerVarriount <Varriount@users.noreply.github.com>2014-04-23 19:47:03 -0400
commit6675b141bb137525463283063124c1b20c5dfcf3 (patch)
treecd26722c24d74af8d59934abbbe7f09354a6a89a /tests
parente3c2441b48e8761e7af4ee57c01ebf4520437694 (diff)
parenta822d0bf0196f2c77f9032a5455c5102f673acad (diff)
downloadNim-6675b141bb137525463283063124c1b20c5dfcf3.tar.gz
Merge pull request #1121 from EXetoC/spawn-test
Add spawn test. Hangs most of the time on linux x64 at least.
Diffstat (limited to 'tests')
-rw-r--r--tests/system/tsysspawn.nim29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/system/tsysspawn.nim b/tests/system/tsysspawn.nim
new file mode 100644
index 000000000..0388918aa
--- /dev/null
+++ b/tests/system/tsysspawn.nim
@@ -0,0 +1,29 @@
+discard """
+  output: '''4
+8'''
+  cmd: "nimrod $target --threads:on $options $file"
+"""
+
+var
+  x, y = 0
+
+proc p1 =
+  for i in 0 .. 1_000_000:
+    discard
+
+  inc x
+
+proc p2 =
+  for i in 0 .. 1_000_000:
+    discard
+
+  inc y, 2
+
+for i in 0.. 3:
+  spawn(p1())
+  spawn(p2())
+
+sync()
+
+echo x
+echo y