]>
Commit | Line | Data |
---|---|---|
cdc7bbd5 | 1 | // |
ba9703b0 | 2 | // We specify -C incremental here because we want to test the partitioning for |
a7813a04 | 3 | // incremental compilation |
ba9703b0 | 4 | // compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/local-inlining |
ea8adc8c | 5 | // compile-flags:-Zinline-in-all-cgus |
a7813a04 XL |
6 | |
7 | #![allow(dead_code)] | |
8 | #![crate_type="lib"] | |
9 | ||
10 | mod inline { | |
11 | ||
12 | // Important: This function should show up in all codegen units where it is inlined | |
1b1a35ee | 13 | //~ MONO_ITEM fn inline::inlined_function @@ local_inlining-user1[Internal] local_inlining-user2[Internal] |
a7813a04 XL |
14 | #[inline(always)] |
15 | pub fn inlined_function() | |
16 | { | |
17 | ||
18 | } | |
19 | } | |
20 | ||
abe05a73 | 21 | pub mod user1 { |
a7813a04 XL |
22 | use super::inline; |
23 | ||
1b1a35ee | 24 | //~ MONO_ITEM fn user1::foo @@ local_inlining-user1[External] |
abe05a73 | 25 | pub fn foo() { |
a7813a04 XL |
26 | inline::inlined_function(); |
27 | } | |
28 | } | |
29 | ||
abe05a73 | 30 | pub mod user2 { |
a7813a04 XL |
31 | use super::inline; |
32 | ||
1b1a35ee | 33 | //~ MONO_ITEM fn user2::bar @@ local_inlining-user2[External] |
abe05a73 | 34 | pub fn bar() { |
a7813a04 XL |
35 | inline::inlined_function(); |
36 | } | |
37 | } | |
38 | ||
abe05a73 | 39 | pub mod non_user { |
a7813a04 | 40 | |
1b1a35ee | 41 | //~ MONO_ITEM fn non_user::baz @@ local_inlining-non_user[External] |
abe05a73 | 42 | pub fn baz() { |
a7813a04 XL |
43 | |
44 | } | |
45 | } |