Rollup merge of #125662 - Oneirical:more-tests-again, r=jieyouxu

Rewrite `fpic`, `simple-dylib` and `issue-37893` `run-make` tests in `rmake.rs` or ui test format

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
This commit is contained in:
León Orell Valerian Liehr 2024-05-30 01:12:35 +02:00 committed by GitHub
commit c2c8e9024f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 43 additions and 32 deletions

View File

@ -71,7 +71,6 @@ run-make/forced-unwind-terminate-pof/Makefile
run-make/foreign-double-unwind/Makefile
run-make/foreign-exceptions/Makefile
run-make/foreign-rust-exceptions/Makefile
run-make/fpic/Makefile
run-make/glibc-staticlib-args/Makefile
run-make/inaccessible-temp-dir/Makefile
run-make/include_bytes_deps/Makefile
@ -102,7 +101,6 @@ run-make/issue-33329/Makefile
run-make/issue-35164/Makefile
run-make/issue-36710/Makefile
run-make/issue-37839/Makefile
run-make/issue-37893/Makefile
run-make/issue-40535/Makefile
run-make/issue-47384/Makefile
run-make/issue-47551/Makefile
@ -233,7 +231,6 @@ run-make/share-generics-dylib/Makefile
run-make/short-ice/Makefile
run-make/silly-file-names/Makefile
run-make/simd-ffi/Makefile
run-make/simple-dylib/Makefile
run-make/split-debuginfo/Makefile
run-make/stable-symbol-names/Makefile
run-make/static-dylib-by-default/Makefile

View File

@ -1,11 +0,0 @@
# ignore-cross-compile
include ../tools.mk
# ignore-windows
# ignore-apple
# Test for #39529.
# `-z text` causes ld to error if there are any non-PIC sections
all:
$(RUSTC) hello.rs -C link-args=-Wl,-z,text

View File

@ -1 +0,0 @@
fn main() { }

View File

@ -1,5 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all:
$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs

View File

@ -0,0 +1,15 @@
// a.rs is a procedural macro crate, on which b.rs and c.rs depend. A now
// patched bug caused a compilation failure if the proc-macro crate was
// initialized with its dependents in this exact order. This test checks
// that compilation succeeds even when initialization is done in this order.
// See https://github.com/rust-lang/rust/issues/37893
//@ ignore-cross-compile
use run_make_support::rustc;
fn main() {
rustc().input("a.rs").run();
rustc().input("b.rs").run();
rustc().input("c.rs").run();
}

View File

@ -1,6 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=dylib -C prefer-dynamic
$(RUSTC) foo.rs
$(call RUN,foo)

View File

@ -1 +0,0 @@
pub fn bar() {}

View File

@ -1,5 +0,0 @@
extern crate bar;
fn main() {
bar::bar();
}

View File

@ -0,0 +1,12 @@
// `-z text` caused the linker to error if there were any non-position-independent
// code (PIC) sections. This test checks that this no longer happens.
// See https://github.com/rust-lang/rust/pull/39803
//@ ignore-windows
//@ ignore-macos
//@ ignore-cross-compile
//@ compile-flags: -Clink-args=-Wl,-z,text
//@ run-pass
fn main() {}

View File

@ -0,0 +1,4 @@
//@ compile-flags: -Cprefer-dynamic
#![crate_type = "dylib"]
pub fn bar() {}

View File

@ -0,0 +1,12 @@
// A simple test, where foo.rs has a dependency
// on the dynamic library simple-dylib.rs. If the test passes,
// dylibs can be built and linked into another file successfully..
//@ aux-crate:bar=simple-dylib.rs
//@ run-pass
extern crate bar;
fn main() {
bar::bar();
}