Skip to content

Commit 5dffd45

Browse files
Make run-make work with other codegen backend than LLVM
1 parent 46a266b commit 5dffd45

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/tools/compiletest/src/runtest/run_make.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ impl TestCx<'_> {
203203
// through a specific CI runner).
204204
.env("LLVM_COMPONENTS", &self.config.llvm_components);
205205

206+
if let Some(codegen_backend) = &self.config.override_codegen_backend {
207+
// In case it's a different codegen backend than LLVM.
208+
cmd.env("RUSTC_CODEGEN_BACKEND", codegen_backend.as_str());
209+
}
210+
206211
// The `run-make-cargo` and `build-std` suites need an in-tree `cargo`, `run-make` does not.
207212
if matches!(self.config.suite, TestSuite::RunMakeCargo | TestSuite::BuildStd) {
208213
cmd.env(

src/tools/run-make-support/src/external_deps/rustc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ pub fn rustc_path() -> String {
7676
fn setup_common() -> Command {
7777
let mut cmd = Command::new(rustc_path());
7878
set_host_compiler_dylib_path(&mut cmd);
79+
if let Ok(codegen_backend) = std::env::var("RUSTC_CODEGEN_BACKEND") {
80+
cmd.arg(format!("-Zcodegen-backend={codegen_backend}"));
81+
}
7982
cmd
8083
}
8184

0 commit comments

Comments
 (0)