Port c-link-to-rust-va-list-fn to Rust

This commit is contained in:
Oneirical 2024-05-11 16:41:07 -04:00
parent 3349155ac0
commit a2e7e79a13
3 changed files with 21 additions and 8 deletions

View File

@ -12,7 +12,6 @@ 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-link-to-rust-va-list-fn/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,7 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all:
$(RUSTC) checkrust.rs
$(CC) test.c $(call STATICLIB,checkrust) $(call OUT_EXE,test) $(EXTRACFLAGS)
$(call RUN,test)

View File

@ -0,0 +1,21 @@
// test.c and its static library checkrust.rs make use of variadic functions (VaList).
// This test checks that the use of this feature does not
// prevent the creation of a functional binary.
// See https://github.com/rust-lang/rust/pull/49878
//@ ignore-cross-compile
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib};
fn main() {
rustc()
.input("checkrust.rs")
.run();
cc()
.input("test.c")
.input(static_lib("checkrust"))
.out_exe("test")
.args(&extra_c_flags())
.run();
run("test");
}