Skip to content

Commit

Permalink
Auto merge of rust-lang#125027 - Oneirical:c-test-with-remove, r=<try>
Browse files Browse the repository at this point in the history
Migrate `run-make/c-link-to-rust-staticlib` to `rmake`

Part of rust-lang#121876.

r? `@jieyouxu`

try-job: dist-x86_64-freebsd
  • Loading branch information
bors committed May 14, 2024
2 parents 8387315 + b1e5e51 commit bb99ac5
Show file tree
Hide file tree
Showing 3 changed files with 19 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.

19 changes: 19 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,19 @@
// 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, 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())
.run();
run("bar");
fs::remove_file(static_lib("foo"));
run("bar");
}

0 comments on commit bb99ac5

Please sign in to comment.