compiletest: add split dwarf compare mode
This commit adds a Split DWARF compare mode to compiletest so that debuginfo tests are also tested using Split DWARF in split mode (and manually in single mode). Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
parent
2b22670bdf
commit
99ad915e32
5 changed files with 27 additions and 1 deletions
|
@ -1037,6 +1037,13 @@ fn preserve_objects_for_their_debuginfo(sess: &Session) -> bool {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Single mode keeps debuginfo in the same object file, but in such a way that it it skipped
|
||||||
|
// by the linker - so it's expected that when codegen units are linked together that this
|
||||||
|
// debuginfo would be lost without keeping around the temps.
|
||||||
|
if sess.opts.debugging_opts.split_dwarf == config::SplitDwarfKind::Single {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// If we're on OSX then the equivalent of split dwarf is turned on by
|
// If we're on OSX then the equivalent of split dwarf is turned on by
|
||||||
// default. The final executable won't actually have any debug information
|
// default. The final executable won't actually have any debug information
|
||||||
// except it'll have pointers to elsewhere. Historically we've always run
|
// except it'll have pointers to elsewhere. Historically we've always run
|
||||||
|
|
|
@ -897,7 +897,12 @@ default_test!(Incremental {
|
||||||
suite: "incremental"
|
suite: "incremental"
|
||||||
});
|
});
|
||||||
|
|
||||||
default_test!(Debuginfo { path: "src/test/debuginfo", mode: "debuginfo", suite: "debuginfo" });
|
default_test_with_compare_mode!(Debuginfo {
|
||||||
|
path: "src/test/debuginfo",
|
||||||
|
mode: "debuginfo",
|
||||||
|
suite: "debuginfo",
|
||||||
|
compare_mode: "split-dwarf"
|
||||||
|
});
|
||||||
|
|
||||||
host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-fulldeps" });
|
host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-fulldeps" });
|
||||||
|
|
||||||
|
|
|
@ -127,6 +127,8 @@ pub enum CompareMode {
|
||||||
Nll,
|
Nll,
|
||||||
Polonius,
|
Polonius,
|
||||||
Chalk,
|
Chalk,
|
||||||
|
SplitDwarf,
|
||||||
|
SplitDwarfSingle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CompareMode {
|
impl CompareMode {
|
||||||
|
@ -135,6 +137,8 @@ impl CompareMode {
|
||||||
CompareMode::Nll => "nll",
|
CompareMode::Nll => "nll",
|
||||||
CompareMode::Polonius => "polonius",
|
CompareMode::Polonius => "polonius",
|
||||||
CompareMode::Chalk => "chalk",
|
CompareMode::Chalk => "chalk",
|
||||||
|
CompareMode::SplitDwarf => "split-dwarf",
|
||||||
|
CompareMode::SplitDwarfSingle => "split-dwarf-single",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +147,8 @@ impl CompareMode {
|
||||||
"nll" => CompareMode::Nll,
|
"nll" => CompareMode::Nll,
|
||||||
"polonius" => CompareMode::Polonius,
|
"polonius" => CompareMode::Polonius,
|
||||||
"chalk" => CompareMode::Chalk,
|
"chalk" => CompareMode::Chalk,
|
||||||
|
"split-dwarf" => CompareMode::SplitDwarf,
|
||||||
|
"split-dwarf-single" => CompareMode::SplitDwarfSingle,
|
||||||
x => panic!("unknown --compare-mode option: {}", x),
|
x => panic!("unknown --compare-mode option: {}", x),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -852,6 +852,8 @@ impl Config {
|
||||||
Some(CompareMode::Nll) => name == "compare-mode-nll",
|
Some(CompareMode::Nll) => name == "compare-mode-nll",
|
||||||
Some(CompareMode::Polonius) => name == "compare-mode-polonius",
|
Some(CompareMode::Polonius) => name == "compare-mode-polonius",
|
||||||
Some(CompareMode::Chalk) => name == "compare-mode-chalk",
|
Some(CompareMode::Chalk) => name == "compare-mode-chalk",
|
||||||
|
Some(CompareMode::SplitDwarf) => name == "compare-mode-split-dwarf",
|
||||||
|
Some(CompareMode::SplitDwarfSingle) => name == "compare-mode-split-dwarf-single",
|
||||||
None => false,
|
None => false,
|
||||||
} ||
|
} ||
|
||||||
(cfg!(debug_assertions) && name == "debug") ||
|
(cfg!(debug_assertions) && name == "debug") ||
|
||||||
|
|
|
@ -2017,6 +2017,12 @@ impl<'test> TestCx<'test> {
|
||||||
Some(CompareMode::Chalk) => {
|
Some(CompareMode::Chalk) => {
|
||||||
rustc.args(&["-Zchalk"]);
|
rustc.args(&["-Zchalk"]);
|
||||||
}
|
}
|
||||||
|
Some(CompareMode::SplitDwarf) => {
|
||||||
|
rustc.args(&["-Zsplit-dwarf=split"]);
|
||||||
|
}
|
||||||
|
Some(CompareMode::SplitDwarfSingle) => {
|
||||||
|
rustc.args(&["-Zsplit-dwarf=single"]);
|
||||||
|
}
|
||||||
None => {}
|
None => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue