Skip to content

Commit

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

Part of #121876.

r? `@jieyouxu`
  • Loading branch information
fmease authored May 15, 2024
2 parents 2e70bea + 91a3f04 commit 2804d42
Show file tree
Hide file tree
Showing 3 changed files with 15 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.

15 changes: 15 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,15 @@
// 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 2804d42

Please sign in to comment.