Enable msvc for link-args-order · rust-lang/rust@3268b2e (original) (raw)
File tree
1 file changed
lines changed
- tests/run-make/link-args-order
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3,15 +3,14 @@ | ||
3 | 3 | // checks that linker arguments remain intact and in the order they were originally passed in. |
4 | 4 | // See https://github.com/rust-lang/rust/pull/70665 |
5 | 5 | |
6 | -//@ ignore-msvc | |
7 | -// Reason: the ld linker does not exist on Windows. | |
8 | - | |
9 | -use run_make_support::rustc; | |
6 | +use run_make_support::{is_msvc, rustc}; | |
10 | 7 | |
11 | 8 | fn main() { |
9 | +let linker = if is_msvc() { "msvc" } else { "ld" }; | |
10 | + | |
12 | 11 | rustc() |
13 | 12 | .input("empty.rs") |
14 | -.linker_flavor("ld") | |
13 | +.linker_flavor(linker) | |
15 | 14 | .link_arg("a") |
16 | 15 | .link_args("b c") |
17 | 16 | .link_args("d e") |
@@ -20,7 +19,7 @@ fn main() { | ||
20 | 19 | .assert_stderr_contains(r#""a" "b" "c" "d" "e" "f""#); |
21 | 20 | rustc() |
22 | 21 | .input("empty.rs") |
23 | -.linker_flavor("ld") | |
22 | +.linker_flavor(linker) | |
24 | 23 | .arg("-Zpre-link-arg=a") |
25 | 24 | .arg("-Zpre-link-args=b c") |
26 | 25 | .arg("-Zpre-link-args=d e") |