diff options
author | Araq <rumpf_a@web.de> | 2014-05-22 08:41:50 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-05-22 08:41:50 +0200 |
commit | 417b9f5a1d13f26842b1337395a0f5b57827cc12 (patch) | |
tree | 5f9f101521b06bd6eed880507b7103f70f46139c /tests/parallel | |
parent | 31b8fd66b1bd54b665e52855909538a50d33d7c3 (diff) | |
download | Nim-417b9f5a1d13f26842b1337395a0f5b57827cc12.tar.gz |
'parallel' statement almost working
Diffstat (limited to 'tests/parallel')
-rw-r--r-- | tests/parallel/tdisjoint_slice1.nim | 16 | ||||
-rw-r--r-- | tests/parallel/tinvalid_array_bounds.nim | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/parallel/tdisjoint_slice1.nim b/tests/parallel/tdisjoint_slice1.nim index 2ca96d6ae..c1d0e52f8 100644 --- a/tests/parallel/tdisjoint_slice1.nim +++ b/tests/parallel/tdisjoint_slice1.nim @@ -1,20 +1,20 @@ +discard """ + outputsub: "EVEN 28" +""" import threadpool -proc f(a: openArray[int]) = - for x in a: echo x - -proc f(a: int) = echo a +proc odd(a: int) = echo "ODD ", a +proc even(a: int) = echo "EVEN ", a proc main() = var a: array[0..30, int] + for i in low(a)..high(a): a[i] = i parallel: - #spawn f(a[0..15]) - #spawn f(a[16..30]) var i = 0 while i <= 29: - spawn f(a[i]) - spawn f(a[i+1]) + spawn even(a[i]) + spawn odd(a[i+1]) inc i, 2 # is correct here diff --git a/tests/parallel/tinvalid_array_bounds.nim b/tests/parallel/tinvalid_array_bounds.nim index 337fae729..4c6065fd6 100644 --- a/tests/parallel/tinvalid_array_bounds.nim +++ b/tests/parallel/tinvalid_array_bounds.nim @@ -1,5 +1,5 @@ discard """ - errormsg: "cannot prove: i + 1 <= 30" + errormsg: "can prove: i + 1 > 30" line: 21 """ |