]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/partitioning/incremental-merging.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / codegen-units / partitioning / incremental-merging.rs
1 // We specify -C incremental here because we want to test the partitioning for
2 // incremental compilation
3 // compile-flags:-Zprint-mono-items=lazy -Cincremental=tmp/partitioning-tests/incremental-merging
4 // compile-flags:-Ccodegen-units=3
5
6 #![crate_type = "rlib"]
7
8 // This test makes sure that merging of CGUs works together with incremental
9 // compilation but at the same time does not modify names of CGUs that were not
10 // affected by merging.
11 //
12 // We expect CGUs `aaa` and `bbb` to be merged (because they are the smallest),
13 // while `ccc` and `ddd` are supposed to stay untouched.
14
15 pub mod aaa {
16 //~ MONO_ITEM fn aaa::foo @@ incremental_merging-aaa--incremental_merging-bbb[External]
17 pub fn foo(a: u64) -> u64 {
18 a + 1
19 }
20 }
21
22 pub mod bbb {
23 //~ MONO_ITEM fn bbb::foo @@ incremental_merging-aaa--incremental_merging-bbb[External]
24 pub fn foo(a: u64, b: u64) -> u64 {
25 a + b + 1
26 }
27 }
28
29 pub mod ccc {
30 //~ MONO_ITEM fn ccc::foo @@ incremental_merging-ccc[External]
31 pub fn foo(a: u64, b: u64, c: u64) -> u64 {
32 a + b + c + 1
33 }
34 }
35
36 pub mod ddd {
37 //~ MONO_ITEM fn ddd::foo @@ incremental_merging-ddd[External]
38 pub fn foo(a: u64, b: u64, c: u64, d: u64) -> u64 {
39 a + b + c + d + 1
40 }
41 }