Add a regression test for channels of nil, which happens to work in rustc, but not in rustboot

This commit is contained in:
Brian Anderson 2011-03-21 21:30:32 -04:00 committed by Graydon Hoare
parent c02cdc32a8
commit 3dcb79dac9
3 changed files with 19 additions and 0 deletions

View File

@ -501,6 +501,7 @@ TASK_XFAILS := $(addprefix $(S)src/test/run-pass/, \
task-comm-12.rs \
task-comm-2.rs \
task-comm-9.rs \
task-comm-chan-nil.rs \
task-life-0.rs \
alt-type-simple.rs \
many.rs)

View File

@ -434,6 +434,7 @@ TASK_XFAILS := test/run-pass/task-comm-8.rs \
test/run-pass/task-comm-12.rs \
test/run-pass/task-comm-2.rs \
test/run-pass/task-comm-9.rs \
test/run-pass/task-comm-chan-nil.rs \
test/run-pass/task-life-0.rs \
test/run-pass/alt-type-simple.rs \
test/run-pass/many.rs

View File

@ -0,0 +1,17 @@
// -*- rust -*-
// rustboot can't transmit nils across channels because they don't have
// any size, but rustc currently can because they do have size. Whether
// or not this is desirable I don't know, but here's a regression test.
impure fn main() {
let port[()] po = port();
let chan[()] ch = chan(po);
ch <| ();
let () n;
n <- po;
check (n == ());
}