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:
commit
c2c8e9024f
@ -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
|
||||
|
@ -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
|
@ -1 +0,0 @@
|
||||
fn main() { }
|
@ -1,5 +0,0 @@
|
||||
# ignore-cross-compile
|
||||
include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs
|
15
tests/run-make/proc-macro-init-order/rmake.rs
Normal file
15
tests/run-make/proc-macro-init-order/rmake.rs
Normal 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();
|
||||
}
|
@ -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)
|
@ -1 +0,0 @@
|
||||
pub fn bar() {}
|
@ -1,5 +0,0 @@
|
||||
extern crate bar;
|
||||
|
||||
fn main() {
|
||||
bar::bar();
|
||||
}
|
12
tests/ui/errors/pic-linker.rs
Normal file
12
tests/ui/errors/pic-linker.rs
Normal 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() {}
|
4
tests/ui/imports/auxiliary/simple-dylib.rs
Normal file
4
tests/ui/imports/auxiliary/simple-dylib.rs
Normal file
@ -0,0 +1,4 @@
|
||||
//@ compile-flags: -Cprefer-dynamic
|
||||
|
||||
#![crate_type = "dylib"]
|
||||
pub fn bar() {}
|
12
tests/ui/imports/simple-dylib-import.rs
Normal file
12
tests/ui/imports/simple-dylib-import.rs
Normal 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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user