2021-04-03 06:05:11 -05:00
|
|
|
//
|
2021-09-19 11:57:19 -05:00
|
|
|
// We specify incremental here because we want to test the partitioning for
|
2016-05-01 12:53:39 -05:00
|
|
|
// incremental compilation
|
2021-09-19 11:57:19 -05:00
|
|
|
// incremental
|
|
|
|
// compile-flags:-Zprint-mono-items=lazy
|
2017-10-06 16:59:33 -05:00
|
|
|
// compile-flags:-Zinline-in-all-cgus
|
2016-03-24 10:40:49 -05:00
|
|
|
|
|
|
|
#![crate_type="lib"]
|
|
|
|
|
|
|
|
// aux-build:cgu_explicit_inlining.rs
|
|
|
|
extern crate cgu_explicit_inlining;
|
|
|
|
|
|
|
|
// This test makes sure that items inlined from external crates are privately
|
|
|
|
// instantiated in every codegen unit they are used in.
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn cgu_explicit_inlining::inlined @@ inlining_from_extern_crate[Internal] inlining_from_extern_crate-mod1[Internal]
|
|
|
|
//~ MONO_ITEM fn cgu_explicit_inlining::always_inlined @@ inlining_from_extern_crate[Internal] inlining_from_extern_crate-mod2[Internal]
|
2016-03-24 10:40:49 -05:00
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn user @@ inlining_from_extern_crate[External]
|
2016-03-24 10:40:49 -05:00
|
|
|
pub fn user()
|
|
|
|
{
|
|
|
|
cgu_explicit_inlining::inlined();
|
|
|
|
cgu_explicit_inlining::always_inlined();
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
// does not generate a monomorphization in this crate
|
2016-03-24 10:40:49 -05:00
|
|
|
cgu_explicit_inlining::never_inlined();
|
|
|
|
}
|
|
|
|
|
2017-10-27 07:31:18 -05:00
|
|
|
pub mod mod1 {
|
2016-03-24 10:40:49 -05:00
|
|
|
use cgu_explicit_inlining;
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn mod1::user @@ inlining_from_extern_crate-mod1[External]
|
2016-03-24 10:40:49 -05:00
|
|
|
pub fn user()
|
|
|
|
{
|
|
|
|
cgu_explicit_inlining::inlined();
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
// does not generate a monomorphization in this crate
|
2016-03-24 10:40:49 -05:00
|
|
|
cgu_explicit_inlining::never_inlined();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-27 07:31:18 -05:00
|
|
|
pub mod mod2 {
|
2016-03-24 10:40:49 -05:00
|
|
|
use cgu_explicit_inlining;
|
|
|
|
|
2020-08-28 08:31:03 -05:00
|
|
|
//~ MONO_ITEM fn mod2::user @@ inlining_from_extern_crate-mod2[External]
|
2016-03-24 10:40:49 -05:00
|
|
|
pub fn user()
|
|
|
|
{
|
|
|
|
cgu_explicit_inlining::always_inlined();
|
|
|
|
|
2018-05-08 08:10:16 -05:00
|
|
|
// does not generate a monomorphization in this crate
|
2016-03-24 10:40:49 -05:00
|
|
|
cgu_explicit_inlining::never_inlined();
|
|
|
|
}
|
|
|
|
}
|