-
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
Showing
2 changed files
with
87 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,87 @@ | ||
// Testing various mixings of rlibs and dylibs. Makes sure that it's possible to | ||
// link an rlib to a dylib. The dependency tree among the file looks like: | ||
// | ||
// foo | ||
// / \ | ||
// bar1 bar2 | ||
// / \ / | ||
// baz baz2 | ||
// | ||
// This is generally testing the permutations of the foo/bar1/bar2 layer against | ||
// the baz/baz2 layer | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{rustc, tmp_dir}; | ||
use std::fs; | ||
|
||
fn main() { | ||
// Building just baz | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz.rs").run(); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz.rs").run(); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
// Building baz2 | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("baz2.rs").run_fail_assert_exit_code(1); | ||
rustc().crate_type("bin").input("baz2.rs").run_fail_assert_exit_code(1); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run; | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("rlib").input("foo.rs").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar2.rs").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("rlib").input("bar1.rs").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
fs::remove_dir_all(tmp_dir()).unwrap(); | ||
fs::create_dir(tmp_dir()).unwrap(); | ||
rustc().crate_type("dylib").input("foo.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar1.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib").input("bar2.rs").arg("-Cprefer-dynamic").run(); | ||
rustc().crate_type("dylib,rlib").input("baz2.rs").run(); | ||
rustc().crate_type("bin").input("baz2.rs").run(); | ||
} |