rust/tests/run-make/c-dynamic-rlib/rmake.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
640 B
Rust
Raw Normal View History

2024-07-17 11:07:28 -05:00
// This test checks that dynamic Rust linking with C does not encounter any errors in both
// compilation and execution, with static dependencies given preference over dynamic.
// (This is the default behaviour.)
// See https://github.com/rust-lang/rust/issues/10434
//@ ignore-cross-compile
// Reason: the compiled binary is executed
2024-07-17 14:11:09 -05:00
use run_make_support::{build_native_dynamic_lib, dynamic_lib_name, rfs, run, run_fail, rustc};
2024-07-17 11:07:28 -05:00
fn main() {
build_native_dynamic_lib("cfoo");
rustc().input("foo.rs").run();
rustc().input("bar.rs").run();
run("bar");
2024-07-17 14:11:09 -05:00
rfs::remove_file(dynamic_lib_name("cfoo"));
2024-07-17 11:07:28 -05:00
run_fail("bar");
}