rewrite extern-fn-with-union to rmake

This commit is contained in:
Oneirical 2024-07-12 15:32:46 -04:00
parent 8a09f2231d
commit 01c7118fa9
4 changed files with 17 additions and 8 deletions

View File

@ -21,7 +21,6 @@ run-make/export-executable-symbols/Makefile
run-make/extern-diff-internal-name/Makefile run-make/extern-diff-internal-name/Makefile
run-make/extern-flag-disambiguates/Makefile run-make/extern-flag-disambiguates/Makefile
run-make/extern-fn-reachable/Makefile run-make/extern-fn-reachable/Makefile
run-make/extern-fn-with-union/Makefile
run-make/extern-multiple-copies/Makefile run-make/extern-multiple-copies/Makefile
run-make/extern-multiple-copies2/Makefile run-make/extern-multiple-copies2/Makefile
run-make/fmt-write-bloat/Makefile run-make/fmt-write-bloat/Makefile

View File

@ -2,6 +2,7 @@
// test simply runs a Rust program containing generics that is also reliant on // test simply runs a Rust program containing generics that is also reliant on
// a C library, and checks that compilation and execution are successful. // a C library, and checks that compilation and execution are successful.
// See https://github.com/rust-lang/rust/pull/15831 // See https://github.com/rust-lang/rust/pull/15831
//@ ignore-cross-compile //@ ignore-cross-compile
// Reason: the compiled binary is executed // Reason: the compiled binary is executed

View File

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

View File

@ -0,0 +1,16 @@
// If an external function from foreign-function interface was called upon,
// its attributes would only be passed to LLVM if and only if it was called in the same crate.
// This caused passing around unions to be incorrect.
// See https://github.com/rust-lang/rust/pull/14191
//@ 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("ctest");
rustc().input("testcrate.rs").run();
rustc().input("test.rs").run();
run("test");
}