]> git.lizzy.rs Git - rust.git/blob - src/test/codegen-units/partitioning/extern-generic.rs
Auto merge of #85961 - 1000teslas:issue-71519-fix, r=petrochenkov
[rust.git] / src / test / codegen-units / partitioning / extern-generic.rs
1 //
2 // We specify -C incremental here because we want to test the partitioning for
3 // incremental compilation
4 // compile-flags:-Zprint-mono-items=eager -Cincremental=tmp/partitioning-tests/extern-generic -Zshare-generics=y
5
6 #![allow(dead_code)]
7 #![crate_type="lib"]
8
9 // aux-build:cgu_generic_function.rs
10 extern crate cgu_generic_function;
11
12 //~ MONO_ITEM fn user @@ extern_generic[Internal]
13 fn user() {
14     let _ = cgu_generic_function::foo("abc");
15 }
16
17 mod mod1 {
18     use cgu_generic_function;
19
20     //~ MONO_ITEM fn mod1::user @@ extern_generic-mod1[Internal]
21     fn user() {
22         let _ = cgu_generic_function::foo("abc");
23     }
24
25     mod mod1 {
26         use cgu_generic_function;
27
28         //~ MONO_ITEM fn mod1::mod1::user @@ extern_generic-mod1-mod1[Internal]
29         fn user() {
30             let _ = cgu_generic_function::foo("abc");
31         }
32     }
33 }
34
35 mod mod2 {
36     use cgu_generic_function;
37
38     //~ MONO_ITEM fn mod2::user @@ extern_generic-mod2[Internal]
39     fn user() {
40         let _ = cgu_generic_function::foo("abc");
41     }
42 }
43
44 mod mod3 {
45     //~ MONO_ITEM fn mod3::non_user @@ extern_generic-mod3[Internal]
46     fn non_user() {}
47 }
48
49 // Make sure the two generic functions from the extern crate get instantiated
50 // once for the current crate
51 //~ MONO_ITEM fn cgu_generic_function::foo::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External]
52 //~ MONO_ITEM fn cgu_generic_function::bar::<&str> @@ cgu_generic_function-in-extern_generic.volatile[External]