Skip to content

Commit 6570a6f

Browse files
committed
Add a test case for #131164
1 parent 916e9ce commit 6570a6f

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

Diff for: tests/run-make/rust-lld-link-script-provide/main.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#[no_mangle]
2+
fn foo() {}
3+
4+
#[no_mangle]
5+
fn bar() {}
6+
7+
fn main() {}

Diff for: tests/run-make/rust-lld-link-script-provide/rmake.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This test ensures that the “symbol not found” error does not occur
2+
// when the symbols in the `PROVIDE` of the link script can be eliminated.
3+
// This is a regression test for #131164.
4+
5+
//@ needs-rust-lld
6+
//@ only-x86_64-unknown-linux-gnu
7+
8+
use run_make_support::rustc;
9+
10+
fn main() {
11+
rustc()
12+
.input("main.rs")
13+
.arg("-Zlinker-features=+lld")
14+
.arg("-Clink-self-contained=+linker")
15+
.arg("-Zunstable-options")
16+
.link_arg("-Tscript.t")
17+
.run();
18+
}

Diff for: tests/run-make/rust-lld-link-script-provide/script.t

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROVIDE(foo = bar);

0 commit comments

Comments
 (0)