Skip to content

Commit

Permalink
Rollup merge of rust-lang#132036 - DianQK:test-131164, r=jieyouxu
Browse files Browse the repository at this point in the history
Add a test case for rust-lang#131164

The upstream has already been fixed, but it won't be backported to LLVM 19.

r? jieyouxu or compiler
  • Loading branch information
matthiaskrgr authored Oct 22, 2024
2 parents 68b59ec + ff00622 commit b87c8d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/run-make/rust-lld-link-script-provide/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#[no_mangle]
fn foo() {}

#[no_mangle]
fn bar() {}

fn main() {}
12 changes: 12 additions & 0 deletions tests/run-make/rust-lld-link-script-provide/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 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").link_arg("-Tscript.t").run();
}
1 change: 1 addition & 0 deletions tests/run-make/rust-lld-link-script-provide/script.t
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROVIDE(foo = bar);

0 comments on commit b87c8d6

Please sign in to comment.