2016-03-24 11:40:49 -04:00
|
|
|
// ignore-tidy-linelength
|
2020-03-23 14:13:54 +11:00
|
|
|
// We specify -C incremental here because we want to test the partitioning for
|
2016-05-01 13:53:39 -04:00
|
|
|
// incremental compilation
|
2020-03-23 14:13:54 +11:00
|
|
|
// compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/local-inlining
|
2017-10-06 14:59:33 -07:00
|
|
|
// compile-flags:-Zinline-in-all-cgus
|
2016-03-24 11:40:49 -04:00
|
|
|
|
|
|
|
#![allow(dead_code)]
|
|
|
|
#![crate_type="lib"]
|
|
|
|
|
|
|
|
mod inline {
|
|
|
|
|
|
|
|
// Important: This function should show up in all codegen units where it is inlined
|
2018-05-08 16:10:16 +03:00
|
|
|
//~ MONO_ITEM fn local_inlining::inline[0]::inlined_function[0] @@ local_inlining-user1[Internal] local_inlining-user2[Internal]
|
2016-03-24 11:40:49 -04:00
|
|
|
#[inline(always)]
|
|
|
|
pub fn inlined_function()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 14:31:18 +02:00
|
|
|
pub mod user1 {
|
2016-03-24 11:40:49 -04:00
|
|
|
use super::inline;
|
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
//~ MONO_ITEM fn local_inlining::user1[0]::foo[0] @@ local_inlining-user1[External]
|
2017-10-27 14:31:18 +02:00
|
|
|
pub fn foo() {
|
2016-03-24 11:40:49 -04:00
|
|
|
inline::inlined_function();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 14:31:18 +02:00
|
|
|
pub mod user2 {
|
2016-03-24 11:40:49 -04:00
|
|
|
use super::inline;
|
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
//~ MONO_ITEM fn local_inlining::user2[0]::bar[0] @@ local_inlining-user2[External]
|
2017-10-27 14:31:18 +02:00
|
|
|
pub fn bar() {
|
2016-03-24 11:40:49 -04:00
|
|
|
inline::inlined_function();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 14:31:18 +02:00
|
|
|
pub mod non_user {
|
2016-03-24 11:40:49 -04:00
|
|
|
|
2018-05-08 16:10:16 +03:00
|
|
|
//~ MONO_ITEM fn local_inlining::non_user[0]::baz[0] @@ local_inlining-non_user[External]
|
2017-10-27 14:31:18 +02:00
|
|
|
pub fn baz() {
|
2016-03-24 11:40:49 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|