Adding a test to make sure CCI works with capture clauses.
This commit is contained in:
parent
f49b891ce5
commit
07830612fd
2 changed files with 25 additions and 0 deletions
12
src/test/auxiliary/cci_capture_clause.rs
Normal file
12
src/test/auxiliary/cci_capture_clause.rs
Normal 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
|
||||
}
|
13
src/test/run-pass/cci_capture_clause.rs
Normal file
13
src/test/run-pass/cci_capture_clause.rs
Normal 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()
|
||||
}
|
Loading…
Add table
Reference in a new issue