-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
df7fd99
commit 13d3b75
Showing
17 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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,11 @@ | ||
# Test using -Cdlltool to change where raw-dylib looks for the dlltool binary. | ||
|
||
# only-windows | ||
# only-gnu | ||
# needs-dlltool | ||
|
||
include ../../run-make-fulldeps/tools.mk | ||
|
||
all: | ||
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs -Cdlltool=$(CURDIR)/script.cmd | ||
$(DIFF) output.txt "$(TMPDIR)"/output.txt |
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,12 @@ | ||
#![feature(raw_dylib)] | ||
|
||
#[link(name = "extern_1", kind = "raw-dylib")] | ||
extern { | ||
fn extern_fn_1(); | ||
} | ||
|
||
pub fn library_function() { | ||
unsafe { | ||
extern_fn_1(); | ||
} | ||
} |
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 @@ | ||
Called dlltool via script.cmd |
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,2 @@ | ||
echo Called dlltool via script.cmd> %TMPDIR%\output.txt | ||
dlltool.exe %* |
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
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
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,20 @@ | ||
// Tests that dlltool failing to generate an import library will raise an error. | ||
|
||
// only-gnu | ||
// only-windows | ||
// needs-dlltool | ||
// compile-flags: --crate-type lib --emit link | ||
// normalize-stderr-test: "[^ ']*/dlltool.exe" -> "$$DLLTOOL" | ||
// normalize-stderr-test: "[^ ]*/foo.def" -> "$$DEF_FILE" | ||
#![feature(raw_dylib)] | ||
#[link(name = "foo", kind = "raw-dylib")] | ||
extern "C" { | ||
// `@1` is an invalid name to export, as it usually indicates that something | ||
// is being exported via ordinal. | ||
#[link_name = "@1"] | ||
fn f(x: i32); | ||
} | ||
|
||
pub fn lib_main() { | ||
unsafe { f(42); } | ||
} |
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 @@ | ||
error: Dlltool could not create import library: $DLLTOOL: Syntax error in def file $DEF_FILE:1 | ||
|
||
error: aborting due to previous error | ||
|
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,14 @@ | ||
// Tests that failing to run dlltool will raise an error. | ||
|
||
// only-gnu | ||
// only-windows | ||
// compile-flags: --crate-type lib --emit link -Cdlltool=does_not_exit.exe | ||
#![feature(raw_dylib)] | ||
#[link(name = "foo", kind = "raw-dylib")] | ||
extern "C" { | ||
fn f(x: i32); | ||
} | ||
|
||
pub fn lib_main() { | ||
unsafe { f(42); } | ||
} |
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 @@ | ||
error: Error calling dlltool 'does_not_exit.exe': program not found | ||
|
||
error: aborting due to previous error | ||
|