rewrite extern-fn-struct-passing-abi to rmake

This commit is contained in:
Oneirical 2024-07-08 14:03:04 -04:00
parent a795d8998d
commit d6a3f65db0
3 changed files with 16 additions and 7 deletions

View File

@ -28,7 +28,6 @@ run-make/extern-fn-explicit-align/Makefile
run-make/extern-fn-generic/Makefile run-make/extern-fn-generic/Makefile
run-make/extern-fn-mangle/Makefile run-make/extern-fn-mangle/Makefile
run-make/extern-fn-reachable/Makefile run-make/extern-fn-reachable/Makefile
run-make/extern-fn-struct-passing-abi/Makefile
run-make/extern-fn-with-packed-struct/Makefile run-make/extern-fn-with-packed-struct/Makefile
run-make/extern-fn-with-union/Makefile run-make/extern-fn-with-union/Makefile
run-make/extern-multiple-copies/Makefile run-make/extern-multiple-copies/Makefile

View File

@ -1,6 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) test.rs
$(call RUN,test) || exit 1

View File

@ -0,0 +1,16 @@
// Functions with more than 6 arguments using foreign function interfaces (FFI) with C libraries
// would have their arguments unexpectedly swapped, causing unexpected behaviour in Rust-C FFI
// programs. This test compiles and executes Rust code with bulky functions of up to 7 arguments
// and uses assertions to check for unexpected swaps.
// See https://github.com/rust-lang/rust/issues/25594
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{build_native_static_lib, run, rustc};
fn main() {
build_native_static_lib("test");
rustc().input("test.rs").run();
run("test");
}