about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/run-make-support/src/rustc.rs7
-rw-r--r--tests/run-make/reachable-extern-fn-available-lto/bar.rs (renamed from tests/run-make/issue-14500/bar.rs)0
-rw-r--r--tests/run-make/reachable-extern-fn-available-lto/foo.c (renamed from tests/run-make/issue-14500/foo.c)0
-rw-r--r--tests/run-make/reachable-extern-fn-available-lto/foo.rs (renamed from tests/run-make/issue-14500/foo.rs)0
-rw-r--r--tests/run-make/reachable-extern-fn-available-lto/rmake.rs (renamed from tests/run-make/issue-14500/rmake.rs)8
5 files changed, 7 insertions, 8 deletions
diff --git a/src/tools/run-make-support/src/rustc.rs b/src/tools/run-make-support/src/rustc.rs
index c92e9f9b11f..0de5a38c0c4 100644
--- a/src/tools/run-make-support/src/rustc.rs
+++ b/src/tools/run-make-support/src/rustc.rs
@@ -150,10 +150,9 @@ impl Rustc {
         self
     }
 
-    /// Pass a codegen option.
-    pub fn codegen_option(&mut self, option: &str) -> &mut Self {
-        self.cmd.arg("-C");
-        self.cmd.arg(option);
+    /// Enables link time optimizations in rustc. Equivalent to `-Clto``.
+    pub fn lto(&mut self) -> &mut Self {
+        self.cmd.arg("-Clto");
         self
     }
 
diff --git a/tests/run-make/issue-14500/bar.rs b/tests/run-make/reachable-extern-fn-available-lto/bar.rs
index 49af74e1b74..49af74e1b74 100644
--- a/tests/run-make/issue-14500/bar.rs
+++ b/tests/run-make/reachable-extern-fn-available-lto/bar.rs
diff --git a/tests/run-make/issue-14500/foo.c b/tests/run-make/reachable-extern-fn-available-lto/foo.c
index 2353d400df3..2353d400df3 100644
--- a/tests/run-make/issue-14500/foo.c
+++ b/tests/run-make/reachable-extern-fn-available-lto/foo.c
diff --git a/tests/run-make/issue-14500/foo.rs b/tests/run-make/reachable-extern-fn-available-lto/foo.rs
index 7c19c1f2c67..7c19c1f2c67 100644
--- a/tests/run-make/issue-14500/foo.rs
+++ b/tests/run-make/reachable-extern-fn-available-lto/foo.rs
diff --git a/tests/run-make/issue-14500/rmake.rs b/tests/run-make/reachable-extern-fn-available-lto/rmake.rs
index 58f632e5909..3e38b92b2b8 100644
--- a/tests/run-make/issue-14500/rmake.rs
+++ b/tests/run-make/reachable-extern-fn-available-lto/rmake.rs
@@ -1,5 +1,5 @@
 // Test to make sure that reachable extern fns are always available in final
-// productcs, including when LTO is used.
+// productcs, including when link time optimizations (LTO) are used.
 
 // In this test, the `foo` crate has a reahable symbol,
 // and is a dependency of the `bar` crate. When the `bar` crate
@@ -9,15 +9,15 @@
 
 //@ ignore-cross-compile
 
-use run_make_support::{cc, extra_c_flags, run, rustc, tmp_dir};
+use run_make_support::{cc, extra_c_flags, run, rustc, static_lib, tmp_dir};
 
 fn main() {
-    let libbar_path = tmp_dir().join("libbar.a");
+    let libbar_path = static_lib("bar");
     rustc().input("foo.rs").crate_type("rlib").run();
     rustc()
         .input("bar.rs")
         .crate_type("staticlib")
-        .codegen_option("lto")
+        .lto()
         .library_search_path(".")
         .output(&libbar_path)
         .run();