rewrite lto-linkage-used-attr to rmake

This commit is contained in:
Oneirical 2024-07-19 16:23:29 -04:00
parent aee3dc4c6c
commit 632f01306b
3 changed files with 14 additions and 9 deletions

View File

@ -47,7 +47,6 @@ run-make/link-cfg/Makefile
run-make/link-framework/Makefile
run-make/long-linker-command-lines-cmd-exe/Makefile
run-make/long-linker-command-lines/Makefile
run-make/lto-linkage-used-attr/Makefile
run-make/macos-deployment-target/Makefile
run-make/min-global-align/Makefile
run-make/native-link-modifier-bundle/Makefile

View File

@ -1,8 +0,0 @@
include ../tools.mk
# Verify that the impl_* symbols are preserved. #108030
# only-x86_64-unknown-linux-gnu
all:
$(RUSTC) -Cdebuginfo=0 -Copt-level=3 lib.rs
$(RUSTC) -Clto=fat -Cdebuginfo=0 -Copt-level=3 main.rs

View File

@ -0,0 +1,14 @@
// Link time optimizations (LTO) used to snip away some important symbols
// when setting optimization level to 3 or higher.
// This is an LLVM, not a rustc bug, fixed here: https://reviews.llvm.org/D145293
// This test checks that the impl_* symbols are preserved as they should.
// See https://github.com/rust-lang/rust/issues/108030
//FIXME(Oneirical): try it on more than only-x86_64-unknown-linux-gnu
use run_make_support::rustc;
fn main() {
rustc().arg("-Cdebuginfo=0").opt_level("3").input("lib.rs").run();
rustc().arg("-Clto=fat").arg("-Cdebuginfo=0").opt_level("3").input("main.rs").run();
}