Add a test case for #131164
This commit is contained in:
parent
916e9ced40
commit
6570a6fe92
7
tests/run-make/rust-lld-link-script-provide/main.rs
Normal file
7
tests/run-make/rust-lld-link-script-provide/main.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#[no_mangle]
|
||||||
|
fn foo() {}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
fn bar() {}
|
||||||
|
|
||||||
|
fn main() {}
|
18
tests/run-make/rust-lld-link-script-provide/rmake.rs
Normal file
18
tests/run-make/rust-lld-link-script-provide/rmake.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// This test ensures that the “symbol not found” error does not occur
|
||||||
|
// when the symbols in the `PROVIDE` of the link script can be eliminated.
|
||||||
|
// This is a regression test for #131164.
|
||||||
|
|
||||||
|
//@ needs-rust-lld
|
||||||
|
//@ only-x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
|
use run_make_support::rustc;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
rustc()
|
||||||
|
.input("main.rs")
|
||||||
|
.arg("-Zlinker-features=+lld")
|
||||||
|
.arg("-Clink-self-contained=+linker")
|
||||||
|
.arg("-Zunstable-options")
|
||||||
|
.link_arg("-Tscript.t")
|
||||||
|
.run();
|
||||||
|
}
|
1
tests/run-make/rust-lld-link-script-provide/script.t
Normal file
1
tests/run-make/rust-lld-link-script-provide/script.t
Normal file
@ -0,0 +1 @@
|
|||||||
|
PROVIDE(foo = bar);
|
Loading…
Reference in New Issue
Block a user