about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/rust-lld-by-default-beta-stable/main.rs1
-rw-r--r--tests/run-make/rust-lld-by-default-beta-stable/rmake.rs14
-rw-r--r--tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist/main.rs (renamed from tests/run-make/rust-lld-by-default-nightly/main.rs)0
-rw-r--r--tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist/rmake.rs (renamed from tests/run-make/rust-lld-by-default-nightly/rmake.rs)11
-rw-r--r--tests/run-make/rust-lld-x86_64-unknown-linux-gnu/main.rs5
-rw-r--r--tests/run-make/rust-lld-x86_64-unknown-linux-gnu/rmake.rs20
6 files changed, 29 insertions, 22 deletions
diff --git a/tests/run-make/rust-lld-by-default-beta-stable/main.rs b/tests/run-make/rust-lld-by-default-beta-stable/main.rs
deleted file mode 100644
index f328e4d9d04..00000000000
--- a/tests/run-make/rust-lld-by-default-beta-stable/main.rs
+++ /dev/null
@@ -1 +0,0 @@
-fn main() {}
diff --git a/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs b/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
deleted file mode 100644
index 9a08991c4b8..00000000000
--- a/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Ensure that rust-lld is *not* used as the default linker on `x86_64-unknown-linux-gnu` on stable
-// or beta.
-
-//@ ignore-nightly
-//@ only-x86_64-unknown-linux-gnu
-
-use run_make_support::linker::assert_rustc_doesnt_use_lld;
-use run_make_support::rustc;
-
-fn main() {
-    // A regular compilation should not use rust-lld by default. We'll check that by asking the
-    // linker to display its version number with a link-arg.
-    assert_rustc_doesnt_use_lld(rustc().input("main.rs"));
-}
diff --git a/tests/run-make/rust-lld-by-default-nightly/main.rs b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist/main.rs
index e9f655fc09e..e9f655fc09e 100644
--- a/tests/run-make/rust-lld-by-default-nightly/main.rs
+++ b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist/main.rs
diff --git a/tests/run-make/rust-lld-by-default-nightly/rmake.rs b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist/rmake.rs
index 3ff1e2770e6..c26f82b7d37 100644
--- a/tests/run-make/rust-lld-by-default-nightly/rmake.rs
+++ b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist/rmake.rs
@@ -1,17 +1,14 @@
-// Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu` on the nightly
-// channel, and that it can also be turned off with a CLI flag.
+// Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu`
+// dist artifacts and that it can also be turned off with a CLI flag.
 
-//@ needs-rust-lld
-//@ ignore-beta
-//@ ignore-stable
+//@ only-dist
 //@ only-x86_64-unknown-linux-gnu
 
 use run_make_support::linker::{assert_rustc_doesnt_use_lld, assert_rustc_uses_lld};
 use run_make_support::rustc;
 
 fn main() {
-    // A regular compilation should use rust-lld by default. We'll check that by asking the linker
-    // to display its version number with a link-arg.
+    // A regular compilation should use rust-lld by default.
     assert_rustc_uses_lld(rustc().input("main.rs"));
 
     // But it can still be disabled by turning the linker feature off.
diff --git a/tests/run-make/rust-lld-x86_64-unknown-linux-gnu/main.rs b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu/main.rs
new file mode 100644
index 00000000000..e9f655fc09e
--- /dev/null
+++ b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu/main.rs
@@ -0,0 +1,5 @@
+// Test linking using `cc` with `rust-lld`, which is on by default on the x86_64-unknown-linux-gnu
+// target.
+// See https://github.com/rust-lang/compiler-team/issues/510 for more info
+
+fn main() {}
diff --git a/tests/run-make/rust-lld-x86_64-unknown-linux-gnu/rmake.rs b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu/rmake.rs
new file mode 100644
index 00000000000..e71a47f11e2
--- /dev/null
+++ b/tests/run-make/rust-lld-x86_64-unknown-linux-gnu/rmake.rs
@@ -0,0 +1,20 @@
+// Ensure that rust-lld is used as the default linker on `x86_64-unknown-linux-gnu`
+// and that it can also be turned off with a CLI flag.
+//
+// This version of the test checks that LLD is used by default when LLD is enabled in the
+// toolchain. There is a separate test that checks that LLD is used for dist artifacts
+// unconditionally.
+
+//@ needs-rust-lld
+//@ only-x86_64-unknown-linux-gnu
+
+use run_make_support::linker::{assert_rustc_doesnt_use_lld, assert_rustc_uses_lld};
+use run_make_support::rustc;
+
+fn main() {
+    // A regular compilation should use rust-lld by default.
+    assert_rustc_uses_lld(rustc().input("main.rs"));
+
+    // But it can still be disabled by turning the linker feature off.
+    assert_rustc_doesnt_use_lld(rustc().arg("-Zlinker-features=-lld").input("main.rs"));
+}