]> git.lizzy.rs Git - rust.git/blob - src/test/codegen-units/partitioning/local-inlining.rs
Rollup merge of #105064 - notriddle:notriddle/main-min-width, r=GuillaumeGomez
[rust.git] / src / test / codegen-units / partitioning / local-inlining.rs
1 //
2 // We specify incremental here because we want to test the partitioning for
3 // incremental compilation
4 // incremental
5 // compile-flags:-Zprint-mono-items=lazy
6 // compile-flags:-Zinline-in-all-cgus
7
8 #![allow(dead_code)]
9 #![crate_type="lib"]
10
11 mod inline {
12
13     // Important: This function should show up in all codegen units where it is inlined
14     //~ MONO_ITEM fn inline::inlined_function @@ local_inlining-user1[Internal] local_inlining-user2[Internal]
15     #[inline(always)]
16     pub fn inlined_function()
17     {
18
19     }
20 }
21
22 pub mod user1 {
23     use super::inline;
24
25     //~ MONO_ITEM fn user1::foo @@ local_inlining-user1[External]
26     pub fn foo() {
27         inline::inlined_function();
28     }
29 }
30
31 pub mod user2 {
32     use super::inline;
33
34     //~ MONO_ITEM fn user2::bar @@ local_inlining-user2[External]
35     pub fn bar() {
36         inline::inlined_function();
37     }
38 }
39
40 pub mod non_user {
41
42     //~ MONO_ITEM fn non_user::baz @@ local_inlining-non_user[External]
43     pub fn baz() {
44
45     }
46 }