rewrite static-extern-type to rmake

This commit is contained in:
Oneirical 2024-07-08 14:35:30 -04:00
parent 98454ece33
commit 205bfe7213
3 changed files with 16 additions and 7 deletions

View File

@ -108,7 +108,6 @@ run-make/simd-ffi/Makefile
run-make/split-debuginfo/Makefile
run-make/stable-symbol-names/Makefile
run-make/static-dylib-by-default/Makefile
run-make/static-extern-type/Makefile
run-make/staticlib-blank-lib/Makefile
run-make/staticlib-dylib-linkage/Makefile
run-make/symbol-mangling-hashed/Makefile

View File

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

View File

@ -0,0 +1,16 @@
// Static variables coming from a C library through foreign function interface (FFI) are unsized
// at compile time - and assuming they are sized used to cause an internal compiler error (ICE).
// After this was fixed in #58192, this test checks that external statics can be safely used in
// a program that both compiles and executes successfully.
// See https://github.com/rust-lang/rust/issues/57876
//@ 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("define-foo");
rustc().arg("-ldefine-foo").input("use-foo.rs").run();
run("use-foo");
}