rust/tests/codegen-units/item-collection/non-generic-functions.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.1 KiB
Rust
Raw Normal View History

2018-05-08 08:10:16 -05:00
// compile-flags:-Zprint-mono-items=eager
#![deny(dead_code)]
#![feature(start)]
//~ MONO_ITEM fn foo
fn foo() {
{
//~ MONO_ITEM fn foo::foo
fn foo() {}
foo();
}
{
//~ MONO_ITEM fn foo::foo
fn foo() {}
foo();
}
}
//~ MONO_ITEM fn bar
fn bar() {
//~ MONO_ITEM fn bar::baz
fn baz() {}
baz();
}
struct Struct { _x: i32 }
impl Struct {
//~ MONO_ITEM fn Struct::foo
fn foo() {
{
//~ MONO_ITEM fn Struct::foo::foo
fn foo() {}
foo();
}
{
//~ MONO_ITEM fn Struct::foo::foo
fn foo() {}
foo();
}
}
//~ MONO_ITEM fn Struct::bar
fn bar(&self) {
{
//~ MONO_ITEM fn Struct::bar::foo
fn foo() {}
foo();
}
{
//~ MONO_ITEM fn Struct::bar::foo
fn foo() {}
foo();
}
}
}
//~ MONO_ITEM fn start
#[start]
fn start(_: isize, _: *const *const u8) -> isize {
foo();
bar();
Struct::foo();
let x = Struct { _x: 0 };
x.bar();
0
}