Adding a test to make sure CCI works with capture clauses.

This commit is contained in:
Eric Holk 2012-05-29 17:48:27 -07:00
parent f49b891ce5
commit 07830612fd
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,12 @@
export foo;
import comm::*;
fn foo<T: send copy>(x: T) -> port<T> {
let p = port();
let c = chan(p);
task::spawn() {|copy c, copy x|
c.send(x);
}
p
}

View file

@ -0,0 +1,13 @@
// aux-build:cci_capture_clause.rs
// This test makes sure we can do cross-crate inlining on functions
// that use capture clauses.
use cci_capture_clause;
import comm::recv;
import comm::methods;
fn main() {
cci_capture_clause::foo(()).recv()
}