Skip to content

Commit d772ab0

Browse files
committed
rewrite c-link-to-rust-staticlib
1 parent 3349155 commit d772ab0

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ run-make/branch-protection-check-IBT/Makefile
1111
run-make/c-dynamic-dylib/Makefile
1212
run-make/c-dynamic-rlib/Makefile
1313
run-make/c-link-to-rust-dylib/Makefile
14-
run-make/c-link-to-rust-staticlib/Makefile
1514
run-make/c-link-to-rust-va-list-fn/Makefile
1615
run-make/c-static-dylib/Makefile
1716
run-make/c-static-rlib/Makefile

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

-16
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
//@ ignore-freebsd
6+
7+
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib};
8+
use std::fs;
9+
10+
fn main() {
11+
rustc().input("foo.rs")
12+
.run();
13+
cc().input("bar.c")
14+
.input(static_lib("foo"))
15+
.out_exe("bar")
16+
.args(&extra_c_flags())
17+
.args(&extra_cxx_flags())
18+
.run();
19+
run("bar");
20+
fs::remove_file(static_lib("foo"));
21+
run("bar");
22+
}

0 commit comments

Comments
 (0)