-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c396e36
commit 6bc4465
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
LIBRARY dll | ||
EXPORTS | ||
hello | ||
number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//@ only-msvc | ||
// Reason: this is testing the MSVC linker | ||
|
||
use run_make_support::run::cmd; | ||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc().crate_type("staticlib").input("static.rs").output("static.lib").run(); | ||
// We call link.exe directly because this test is only for MSVC and not their LLVM equivalents | ||
cmd("cl.exe").args(&["c.c", "-nologo", "-c", "-MT"]).run(); | ||
cmd("link.exe") | ||
.args(&["c", "/WHOLEARCHIVE:./static.lib", "/dll", "/def:dll.def", "/out:dll.dll"]) | ||
// Import libs | ||
.args(&["libcmt.lib", "kernel32.lib", "ws2_32.lib", "ntdll.lib", "userenv.lib"]) | ||
.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#[no_mangle] | ||
pub extern "C" fn hello() { | ||
println!("Hello world!"); | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "C" fn number() -> u32 { | ||
42 | ||
} |