2024-05-11 17:20:31 -04: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 13:31:38 +00:00
|
|
|
use run_make_support::rfs::remove_file;
|
2024-06-07 14:10:27 +02:00
|
|
|
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};
|
2024-05-11 17:20:31 -04:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
rustc().input("foo.rs").run();
|
2024-06-30 12:40:24 +02:00
|
|
|
cc().input("bar.c").input(static_lib_name("foo")).out_exe("bar").args(extra_c_flags()).run();
|
2024-05-11 17:20:31 -04:00
|
|
|
run("bar");
|
2024-06-06 20:47:00 +02:00
|
|
|
remove_file(static_lib_name("foo"));
|
2024-05-11 17:20:31 -04:00
|
|
|
run("bar");
|
|
|
|
}
|