diff options
Diffstat (limited to 'tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs')
-rw-r--r-- | tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs b/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs new file mode 100644 index 000000000..05ea0a89f --- /dev/null +++ b/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs @@ -0,0 +1,23 @@ +#![crate_type = "lib"] + +#[inline] +pub fn inlined_fn(x: i32, y: i32) -> i32 { + + let closure = |a, b| { a + b }; + + closure(x, y) +} + +pub fn inlined_fn_generic<T>(x: i32, y: i32, z: T) -> (i32, T) { + + let closure = |a, b| { a + b }; + + (closure(x, y), z) +} + +pub fn non_inlined_fn(x: i32, y: i32) -> i32 { + + let closure = |a, b| { a + b }; + + closure(x, y) +} |