about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-11-03 16:55:33 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-11-03 16:55:33 +0100
commit39103ced582f1111af41326f904966aedd8bc47f (patch)
tree27e98c2fa007900265ed09db6e61f3c9bfbc89a3
parentffe52882ed79be67344dd6085559e308241e7f60 (diff)
downloadrust-39103ced582f1111af41326f904966aedd8bc47f.tar.gz
rust-39103ced582f1111af41326f904966aedd8bc47f.zip
Fix run-make tests running when LLVM is disabled
-rw-r--r--src/bootstrap/test.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 6c2c05ac719..97aad8ed646 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1203,17 +1203,6 @@ note: if you're sure you want to do this, please open an issue as to why. In the
             // Only pass correct values for these flags for the `run-make` suite as it
             // requires that a C++ compiler was configured which isn't always the case.
             if !builder.config.dry_run && matches!(suite, "run-make" | "run-make-fulldeps") {
-                cmd.arg("--cc")
-                    .arg(builder.cc(target))
-                    .arg("--cxx")
-                    .arg(builder.cxx(target).unwrap())
-                    .arg("--cflags")
-                    .arg(builder.cflags(target, GitRepo::Rustc).join(" "));
-                copts_passed = true;
-                if let Some(ar) = builder.ar(target) {
-                    cmd.arg("--ar").arg(ar);
-                }
-
                 // The llvm/bin directory contains many useful cross-platform
                 // tools. Pass the path to run-make tests so they can use them.
                 let llvm_bin_path = llvm_config
@@ -1239,6 +1228,21 @@ note: if you're sure you want to do this, please open an issue as to why. In the
             }
         }
 
+        // Only pass correct values for these flags for the `run-make` suite as it
+        // requires that a C++ compiler was configured which isn't always the case.
+        if !builder.config.dry_run && matches!(suite, "run-make" | "run-make-fulldeps") {
+            cmd.arg("--cc")
+                .arg(builder.cc(target))
+                .arg("--cxx")
+                .arg(builder.cxx(target).unwrap())
+                .arg("--cflags")
+                .arg(builder.cflags(target, GitRepo::Rustc).join(" "));
+            copts_passed = true;
+            if let Some(ar) = builder.ar(target) {
+                cmd.arg("--ar").arg(ar);
+            }
+        }
+
         if !llvm_components_passed {
             cmd.arg("--llvm-components").arg("");
         }