]> git.lizzy.rs Git - rust.git/blob - tests/incremental/split_debuginfo_mode.rs
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
[rust.git] / tests / incremental / split_debuginfo_mode.rs
1 // This test case makes sure that changing split-debuginfo commandline options triggers a full re-compilation.
2 // We only test on x86_64-unknown-linux-gnu because there all combinations split-debuginfo settings are valid
3 // and the test is platform-independent otherwise.
4
5 // ignore-tidy-linelength
6 // only-x86_64-unknown-linux-gnu
7 // revisions:rpass1 rpass2 rpass3 rpass4
8
9 // [rpass1]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
10 // [rpass2]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
11 // [rpass3]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split -Zsplit-dwarf-inlining=on
12 // [rpass4]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split -Zsplit-dwarf-inlining=off
13
14 #![feature(rustc_attrs)]
15 // For rpass2 we change -Csplit-debuginfo and thus expect every CGU to be recompiled
16 #![rustc_partition_codegened(module = "split_debuginfo_mode", cfg = "rpass2")]
17 #![rustc_partition_codegened(module = "split_debuginfo_mode-another_module", cfg = "rpass2")]
18 // For rpass3 we change -Zsplit-dwarf-kind and thus also expect every CGU to be recompiled
19 #![rustc_partition_codegened(module = "split_debuginfo_mode", cfg = "rpass3")]
20 #![rustc_partition_codegened(module = "split_debuginfo_mode-another_module", cfg = "rpass3")]
21 // For rpass4 we change -Zsplit-dwarf-inlining and thus also expect every CGU to be recompiled
22 #![rustc_partition_codegened(module = "split_debuginfo_mode", cfg = "rpass4")]
23 #![rustc_partition_codegened(module = "split_debuginfo_mode-another_module", cfg = "rpass4")]
24
25 mod another_module {
26     pub fn foo() -> &'static str {
27         "hello world"
28     }
29 }
30
31 pub fn main() {
32     println!("{}", another_module::foo());
33 }