Skip to content

Commit cadcc1c

Browse files
committed
bootstrap: Ignore rust.debuginfo-level-tests for codegen tests
codegen tests typically depend on the raw LLVM IR output and are sensitive to debuginfo level. So do not apply `rust.debuginfo-level-tests` for codegen tests. Before this commit: $ ./x test --set rust.debuginfo-level-tests=2 tests/codegen --force-rerun test result: FAILED. 654 passed; 136 failed; 75 ignored; 0 measured; 0 filtered out; finished in 3.22s After this commit: $ ./x test --set rust.debuginfo-level-tests=2 tests/codegen --force-rerun NOTE: ignoring `rust.debuginfo-level-tests=2` for codegen tests test result: ok. 790 passed; 0 failed; 75 ignored; 0 measured; 0 filtered out; finished in 3.21s
1 parent bf5e6cc commit cadcc1c

File tree

1 file changed

+18
-1
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+18
-1
lines changed

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,24 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
18101810
}
18111811

18121812
let mut flags = if is_rustdoc { Vec::new() } else { vec!["-Crpath".to_string()] };
1813-
flags.push(format!("-Cdebuginfo={}", builder.config.rust_debuginfo_level_tests));
1813+
flags.push(format!(
1814+
"-Cdebuginfo={}",
1815+
if suite == "codegen" {
1816+
// codegen tests typically check LLVM IR and are sensitive to additional debuginfo.
1817+
// So do not apply `rust.debuginfo-level-tests` for codegen tests.
1818+
if builder.config.rust_debuginfo_level_tests
1819+
!= crate::core::config::DebuginfoLevel::None
1820+
{
1821+
println!(
1822+
"NOTE: ignoring `rust.debuginfo-level-tests={}` for codegen tests",
1823+
builder.config.rust_debuginfo_level_tests
1824+
);
1825+
}
1826+
crate::core::config::DebuginfoLevel::None
1827+
} else {
1828+
builder.config.rust_debuginfo_level_tests
1829+
}
1830+
));
18141831
flags.extend(builder.config.cmd.compiletest_rustc_args().iter().map(|s| s.to_string()));
18151832

18161833
if suite != "mir-opt" {

0 commit comments

Comments
 (0)