rust/tests/run-make/c-link-to-rust-staticlib/rmake.rs

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

16 lines
513 B
Rust
Raw Normal View History

2024-05-11 16:20:31 -05:00
// This test checks that C linking with Rust does not encounter any errors, with a static library.
// See https://github.com/rust-lang/rust/issues/10434
//@ ignore-cross-compile
2024-07-17 08:31:38 -05:00
use run_make_support::rfs::remove_file;
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};
2024-05-11 16:20:31 -05:00
fn main() {
rustc().input("foo.rs").run();
cc().input("bar.c").input(static_lib_name("foo")).out_exe("bar").args(extra_c_flags()).run();
2024-05-11 16:20:31 -05:00
run("bar");
remove_file(static_lib_name("foo"));
2024-05-11 16:20:31 -05:00
run("bar");
}