Rollup merge of #125027 - Oneirical:c-test-with-remove, r=jieyouxu · rust-lang/rust@2804d42 (original) (raw)

File tree

3 files changed

lines changed

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ run-make/branch-protection-check-IBT/Makefile
8 8 run-make/c-dynamic-dylib/Makefile
9 9 run-make/c-dynamic-rlib/Makefile
10 10 run-make/c-link-to-rust-dylib/Makefile
11 -run-make/c-link-to-rust-staticlib/Makefile
12 11 run-make/c-static-dylib/Makefile
13 12 run-make/c-static-rlib/Makefile
14 13 run-make/c-unwind-abi-catch-lib-panic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
1 +// This test checks that C linking with Rust does not encounter any errors, with a static library.
2 +// See https://github.com/rust-lang/rust/issues/10434
3 +
4 +//@ ignore-cross-compile
5 +
6 +use run_make_support::{cc, extra_c_flags, run, rustc, static_lib};
7 +use std::fs;
8 +
9 +fn main() {
10 +rustc().input("foo.rs").run();
11 +cc().input("bar.c").input(static_lib("foo")).out_exe("bar").args(&extra_c_flags()).run();
12 +run("bar");
13 + fs::remove_file(static_lib("foo"));
14 +run("bar");
15 +}