Skip to content

Commit

Permalink
rewrite c-link-to-rust-staticlib
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed May 14, 2024
1 parent 8387315 commit 1f5837a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ run-make/branch-protection-check-IBT/Makefile
run-make/c-dynamic-dylib/Makefile
run-make/c-dynamic-rlib/Makefile
run-make/c-link-to-rust-dylib/Makefile
run-make/c-link-to-rust-staticlib/Makefile
run-make/c-static-dylib/Makefile
run-make/c-static-rlib/Makefile
run-make/c-unwind-abi-catch-lib-panic/Makefile
Expand Down
16 changes: 0 additions & 16 deletions tests/run-make/c-link-to-rust-staticlib/Makefile

This file was deleted.

20 changes: 20 additions & 0 deletions tests/run-make/c-link-to-rust-staticlib/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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

use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib};
use std::fs;

fn main() {
rustc().input("foo.rs").run();
cc().input("bar.c")
.input(static_lib("foo"))
.out_exe("bar")
.args(&extra_c_flags())
.args(&extra_cxx_flags())
.run();
run("bar");
fs::remove_file(static_lib("foo"));
run("bar");
}

0 comments on commit 1f5837a

Please sign in to comment.