]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/item-collection/cross-crate-closures.rs
New upstream version 1.12.0+dfsg1
[rustc.git] / src / test / codegen-units / item-collection / cross-crate-closures.rs
1 // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // In the current version of the collector that still has to support
12 // legacy-trans, closures do not generate their own TransItems, so we are
13 // ignoring this test until MIR trans has taken over completely
14 // ignore-test
15
16 // ignore-tidy-linelength
17 // compile-flags:-Zprint-trans-items=eager
18
19 #![deny(dead_code)]
20
21 // aux-build:cgu_extern_closures.rs
22 extern crate cgu_extern_closures;
23
24 //~ TRANS_ITEM fn cross_crate_closures::main[0]
25 fn main() {
26
27 //~ TRANS_ITEM fn cgu_extern_closures::inlined_fn[0]
28 //~ TRANS_ITEM fn cgu_extern_closures::inlined_fn[0]::{{closure}}[0]
29 let _ = cgu_extern_closures::inlined_fn(1, 2);
30
31 //~ TRANS_ITEM fn cgu_extern_closures::inlined_fn_generic[0]<i32>
32 //~ TRANS_ITEM fn cgu_extern_closures::inlined_fn_generic[0]::{{closure}}[0]<i32>
33 let _ = cgu_extern_closures::inlined_fn_generic(3, 4, 5i32);
34
35 // Nothing should be generated for this call, we just link to the instance
36 // in the extern crate.
37 let _ = cgu_extern_closures::non_inlined_fn(6, 7);
38 }
39
40 //~ TRANS_ITEM drop-glue i8