about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
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