Update and un-XFAIL run-pass/many.rs

This commit is contained in:
Brian Anderson 2011-08-10 22:06:46 -07:00
parent 4ff6763b60
commit 29ceb41cc3

View file

@ -1,24 +1,21 @@
// xfail-stage1
// xfail-stage2
// xfail-stage3
// -*- rust -*-
fn sub(chan[int] parent, int id) {
fn sub(parent: chan[int], id: int) {
if (id == 0) {
parent <| 0;
} else {
let port[int] p = port();
auto child = spawn sub(chan(p), id-1);
let int y; p |> y;
let p: port[int] = port();
let child = spawn sub(chan(p), id-1);
let y: int; p |> y;
parent <| y + 1;
}
}
fn main() {
let port[int] p = port();
auto child = spawn sub(chan(p), 500);
let int p |> y;
let p: port[int] = port();
let child = spawn sub(chan(p), 200);
let y: int; p |> y;
log "transmission complete";
log y;
assert (y == 500);
assert (y == 200);
}