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

File tree

3 files changed

lines changed

3 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -8,7 +8,6 @@ run-make/branch-protection-check-IBT/Makefile

88

run-make/c-dynamic-dylib/Makefile

99

run-make/c-dynamic-rlib/Makefile

1010

run-make/c-link-to-rust-dylib/Makefile

11-

run-make/c-link-to-rust-staticlib/Makefile

1211

run-make/c-static-dylib/Makefile

1312

run-make/c-static-rlib/Makefile

1413

run-make/c-unwind-abi-catch-lib-panic/Makefile

Original file line numberDiff line numberDiff 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+

}