about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-22 19:41:13 +0000
committerbors <bors@rust-lang.org>2014-07-22 19:41:13 +0000
commitbc6bbc3db16f78dc49e7311a4d0d0668f6cb801e (patch)
tree25ae794a21c6adda28cf804551404e38b664c6fd /src
parent31c908b7be51899b16935dbd453718bdcbee431a (diff)
parent6ebbc6c4a3c82f7321e84b15abc9228ef1bdd68c (diff)
downloadrust-bc6bbc3db16f78dc49e7311a4d0d0668f6cb801e.tar.gz
rust-bc6bbc3db16f78dc49e7311a4d0d0668f6cb801e.zip
auto merge of #15869 : alexcrichton/rust/issue-15828, r=kballard
Closes #15828
Diffstat (limited to 'src')
-rw-r--r--src/librustc/back/link.rs11
-rw-r--r--src/test/run-make/crate-data-smoke/Makefile7
2 files changed, 14 insertions, 4 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index cc73cdce6a8..c7dca1b93ef 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -937,7 +937,16 @@ pub fn filename_for_input(sess: &Session,
         config::CrateTypeStaticlib => {
             out_filename.with_filename(format!("lib{}.a", libname))
         }
-        config::CrateTypeExecutable => out_filename.clone(),
+        config::CrateTypeExecutable => {
+            match sess.targ_cfg.os {
+                abi::OsWin32 => out_filename.with_extension("exe"),
+                abi::OsMacos |
+                abi::OsLinux |
+                abi::OsAndroid |
+                abi::OsFreebsd |
+                abi::OsiOS => out_filename.clone(),
+            }
+        }
     }
 }
 
diff --git a/src/test/run-make/crate-data-smoke/Makefile b/src/test/run-make/crate-data-smoke/Makefile
index 23d155fe23d..093796e1dc2 100644
--- a/src/test/run-make/crate-data-smoke/Makefile
+++ b/src/test/run-make/crate-data-smoke/Makefile
@@ -2,8 +2,9 @@
 
 all:
 	[ `$(RUSTC) --print-crate-name crate.rs` = "foo" ]
-	[ `$(RUSTC) --print-file-name crate.rs` = "foo" ]
-	[ `$(RUSTC) --print-file-name --crate-type=lib --test crate.rs` = "foo" ]
-	[ `$(RUSTC) --print-file-name --test lib.rs` = "mylib" ]
+	[ `$(RUSTC) --print-file-name crate.rs` = "$(call BIN,foo)" ]
+	[ `$(RUSTC) --print-file-name --crate-type=lib \
+		--test crate.rs` = "$(call BIN,foo)" ]
+	[ `$(RUSTC) --print-file-name --test lib.rs` = "$(call BIN,mylib)" ]
 	$(RUSTC) --print-file-name lib.rs
 	$(RUSTC) --print-file-name rlib.rs