Skip to content

Commit 862e782

Browse files
committed
rewrite lto-no-link-whole-rlib to rmake
1 parent cb28fc8 commit 862e782

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ run-make/long-linker-command-lines-cmd-exe/Makefile
6565
run-make/long-linker-command-lines/Makefile
6666
run-make/longjmp-across-rust/Makefile
6767
run-make/lto-linkage-used-attr/Makefile
68-
run-make/lto-no-link-whole-rlib/Makefile
6968
run-make/lto-smoke-c/Makefile
7069
run-make/macos-deployment-target/Makefile
7170
run-make/macos-fat-archive/Makefile

tests/run-make/lto-no-link-whole-rlib/Makefile

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// In order to improve linking performance, entire rlibs will only be linked if a dylib is being
2+
// created. Otherwise, an executable will only link one rlib as usual. Linking will fail in this
3+
// test should this optimization be reverted.
4+
// See https://github.com/rust-lang/rust/pull/31460
5+
6+
//@ ignore-cross-compile
7+
// Reason: the compiled binary is executed
8+
9+
use run_make_support::{build_native_static_lib, run, rustc};
10+
11+
fn main() {
12+
build_native_static_lib("foo");
13+
build_native_static_lib("bar");
14+
rustc().input("lib1.rs").run();
15+
rustc().input("lib2.rs").run();
16+
rustc().input("main.rs").arg("-Clto").run();
17+
run("main");
18+
}

0 commit comments

Comments
 (0)