2023-10-06 19:29:42 -05:00
|
|
|
// compile-flags:-Zprint-mono-items=eager -Copt-level=0
|
2015-11-02 07:46:39 -06:00
|
|
|
|
|
|
|
#![deny(dead_code)]
|
2017-12-22 08:31:51 -06:00
|
|
|
#![feature(start)]
|
2015-11-02 07:46:39 -06:00
|
|
|
|
|
|
|
fn generic_fn<T>(a: T) -> (T, i32) {
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn generic_fn::nested_fn
|
2015-11-02 07:46:39 -06:00
|
|
|
fn nested_fn(a: i32) -> i32 {
|
|
|
|
a + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
let x = {
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn generic_fn::nested_fn
|
2015-11-02 07:46:39 -06:00
|
|
|
fn nested_fn(a: i32) -> i32 {
|
|
|
|
a + 2
|
|
|
|
}
|
|
|
|
|
|
|
|
1 + nested_fn(1)
|
|
|
|
};
|
|
|
|
|
|
|
|
return (a, x + nested_fn(0));
|
|
|
|
}
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn start
|
2017-12-22 08:31:51 -06:00
|
|
|
#[start]
|
|
|
|
fn start(_: isize, _: *const *const u8) -> isize {
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn generic_fn::<i64>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = generic_fn(0i64);
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn generic_fn::<u16>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = generic_fn(0u16);
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn generic_fn::<i8>
|
2015-11-02 07:46:39 -06:00
|
|
|
let _ = generic_fn(0i8);
|
2017-12-22 08:31:51 -06:00
|
|
|
|
|
|
|
0
|
2015-11-02 07:46:39 -06:00
|
|
|
}
|