Rollup merge of #125027 - Oneirical:c-test-with-remove, r=jieyouxu

Migrate `run-make/c-link-to-rust-staticlib` to `rmake`

Part of #121876.

r? `@jieyouxu`
This commit is contained in:
León Orell Valerian Liehr 2024-05-15 14:21:38 +02:00 committed by GitHub
commit 2804d4223b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 17 deletions

View file

@ -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

View file

@ -1,16 +0,0 @@
# This test checks that C linking with Rust does not encounter any errors, with static libraries.
# See https://github.com/rust-lang/rust/issues/10434
# ignore-cross-compile
include ../tools.mk
# ignore-freebsd
# FIXME
all:
$(RUSTC) foo.rs
$(CC) bar.c $(call STATICLIB,foo) $(call OUT_EXE,bar) \
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
$(call RUN,bar)
rm $(call STATICLIB,foo)
$(call RUN,bar)

View file

@ -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");
}