]>
Commit | Line | Data |
---|---|---|
a7813a04 | 1 | // ignore-tidy-linelength |
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=eager -Cincremental=tmp/partitioning-tests/extern-generic -Zshare-generics=y |
a7813a04 XL |
5 | |
6 | #![allow(dead_code)] | |
7 | #![crate_type="lib"] | |
8 | ||
9 | // aux-build:cgu_generic_function.rs | |
10 | extern crate cgu_generic_function; | |
11 | ||
1b1a35ee | 12 | //~ MONO_ITEM fn user @@ extern_generic[Internal] |
a7813a04 XL |
13 | fn user() { |
14 | let _ = cgu_generic_function::foo("abc"); | |
15 | } | |
16 | ||
17 | mod mod1 { | |
18 | use cgu_generic_function; | |
19 | ||
1b1a35ee | 20 | //~ MONO_ITEM fn mod1::user @@ extern_generic-mod1[Internal] |
a7813a04 XL |
21 | fn user() { |
22 | let _ = cgu_generic_function::foo("abc"); | |
23 | } | |
24 | ||
25 | mod mod1 { | |
26 | use cgu_generic_function; | |
27 | ||
1b1a35ee | 28 | //~ MONO_ITEM fn mod1::mod1::user @@ extern_generic-mod1-mod1[Internal] |
a7813a04 XL |
29 | fn user() { |
30 | let _ = cgu_generic_function::foo("abc"); | |
31 | } | |
32 | } | |
33 | } | |
34 | ||
35 | mod mod2 { | |
36 | use cgu_generic_function; | |
37 | ||
1b1a35ee | 38 | //~ MONO_ITEM fn mod2::user @@ extern_generic-mod2[Internal] |
a7813a04 XL |
39 | fn user() { |
40 | let _ = cgu_generic_function::foo("abc"); | |
41 | } | |
42 | } | |
43 | ||
44 | mod mod3 { | |
1b1a35ee | 45 | //~ MONO_ITEM fn mod3::non_user @@ extern_generic-mod3[Internal] |
a7813a04 XL |
46 | fn non_user() {} |
47 | } | |
48 | ||
49 | // Make sure the two generic functions from the extern crate get instantiated | |
32a655c1 | 50 | // once for the current crate |
1b1a35ee XL |
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] |