about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-08-06 22:17:33 -0500
committerGitHub <noreply@github.com>2024-08-06 22:17:33 -0500
commit0761d2af61620b385e5ae8f7f621c16c812ca2ed (patch)
tree1a9173d95b2bca1546bffe190d33da209c702c40
parentcc42e3439186d0f159d1f69bf200e8c51f1b3169 (diff)
parent3268b2e18d33146f7df17b29421f8c6df3737afe (diff)
downloadrust-0761d2af61620b385e5ae8f7f621c16c812ca2ed.tar.gz
rust-0761d2af61620b385e5ae8f7f621c16c812ca2ed.zip
Rollup merge of #128647 - ChrisDenton:link-args-order, r=jieyouxu
Enable msvc for link-args-order

I could not see any reason in #70665 why this test needs to specifically use `ld`. Maybe to provide a consistent linker input line? In any case, the test does work for the MSVC linker.

try-job: i686-msvc
try-job: x86_64-msvc
-rw-r--r--tests/run-make/link-args-order/rmake.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/run-make/link-args-order/rmake.rs b/tests/run-make/link-args-order/rmake.rs
index d238ad23f27..b7ef8333267 100644
--- a/tests/run-make/link-args-order/rmake.rs
+++ b/tests/run-make/link-args-order/rmake.rs
@@ -3,15 +3,14 @@
 // checks that linker arguments remain intact and in the order they were originally passed in.
 // See https://github.com/rust-lang/rust/pull/70665
 
-//@ ignore-msvc
-// Reason: the ld linker does not exist on Windows.
-
-use run_make_support::rustc;
+use run_make_support::{is_msvc, rustc};
 
 fn main() {
+    let linker = if is_msvc() { "msvc" } else { "ld" };
+
     rustc()
         .input("empty.rs")
-        .linker_flavor("ld")
+        .linker_flavor(linker)
         .link_arg("a")
         .link_args("b c")
         .link_args("d e")
@@ -20,7 +19,7 @@ fn main() {
         .assert_stderr_contains(r#""a" "b" "c" "d" "e" "f""#);
     rustc()
         .input("empty.rs")
-        .linker_flavor("ld")
+        .linker_flavor(linker)
         .arg("-Zpre-link-arg=a")
         .arg("-Zpre-link-args=b c")
         .arg("-Zpre-link-args=d e")