diff --git a/src/test/auxiliary/cci_capture_clause.rs b/src/test/auxiliary/cci_capture_clause.rs new file mode 100644 index 00000000000..07223c10049 --- /dev/null +++ b/src/test/auxiliary/cci_capture_clause.rs @@ -0,0 +1,12 @@ +export foo; + +import comm::*; + +fn foo(x: T) -> port { + let p = port(); + let c = chan(p); + task::spawn() {|copy c, copy x| + c.send(x); + } + p +} diff --git a/src/test/run-pass/cci_capture_clause.rs b/src/test/run-pass/cci_capture_clause.rs new file mode 100644 index 00000000000..118c15a4dea --- /dev/null +++ b/src/test/run-pass/cci_capture_clause.rs @@ -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() +}