]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/thinlto/cgu_invalidated_when_import_added.rs
1 // revisions: cfail1 cfail2
2 // compile-flags: -O -Zhuman-readable-cgu-names -Cllvm-args=-import-instr-limit=10
5 // rust-lang/rust#59535:
7 // This is analogous to cgu_invalidated_when_import_removed.rs, but it covers
8 // the other direction:
10 // We start with a call-graph like `[A] -> [B -> D] [C]` (where the letters are
11 // functions and the modules are enclosed in `[]`), and add a new call `D <- C`,
12 // yielding the new call-graph: `[A] -> [B -> D] <- [C]`
14 // The effect of this is that the compiler previously classfied `D` as internal
15 // and the import-set of `[A]` to be just `B`. But after adding the `D <- C` call,
16 // `D` is no longer classified as internal, and the import-set of `[A]` becomes
19 // We check this case because an early proposed pull request included an
20 // assertion that the import-sets monotonically decreased over time, a claim
21 // which this test case proves to be false.
30 // In cfail1, ThinLTO decides that foo() does not get inlined into main, and
31 // instead bar() gets inlined into foo().
32 // In cfail2, foo() gets inlined into main.
37 // This function needs to be big so that it does not get inlined by ThinLTO
38 // but *does* get inlined into foo() when it is declared `internal` in