diff options
author | Varriount <Varriount@users.noreply.github.com> | 2014-04-23 19:47:03 -0400 |
---|---|---|
committer | Varriount <Varriount@users.noreply.github.com> | 2014-04-23 19:47:03 -0400 |
commit | 6675b141bb137525463283063124c1b20c5dfcf3 (patch) | |
tree | cd26722c24d74af8d59934abbbe7f09354a6a89a /tests | |
parent | e3c2441b48e8761e7af4ee57c01ebf4520437694 (diff) | |
parent | a822d0bf0196f2c77f9032a5455c5102f673acad (diff) | |
download | Nim-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.nim | 29 |
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 |