-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #127990 - Oneirical:ii-the-high-priestest, r=<try>
Migrate `lto-linkage-used-attr`, `no-duplicate-libs` and `pgo-gen-no-imp-symbols` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc try-job: aarch64-apple
- Loading branch information
Showing
7 changed files
with
62 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// The rust compiler used to try to detect duplicated libraries in | ||
// the linking order and remove the duplicates... but certain edge cases, | ||
// such as the one presented in `foo` and `bar` in this test, demand precise | ||
// control over the link order, including duplicates. As the anti-duplication | ||
// filter was removed, this test should now successfully see main be compiled | ||
// and executed. | ||
// See https://github.com/rust-lang/rust/pull/12688 | ||
|
||
//@ ignore-cross-compile | ||
// Reason: the compiled binary is executed | ||
|
||
// FIXME(Oneirical): try on msvc because of #27979 | ||
|
||
use run_make_support::{build_native_static_lib, run, rustc}; | ||
|
||
fn main() { | ||
build_native_static_lib("foo"); | ||
build_native_static_lib("bar"); | ||
rustc().input("main.rs").run(); | ||
run("main"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// LLVM's profiling instrumentation adds a few symbols that are used by the profiler runtime. | ||
// Since these show up as globals in the LLVM IR, the compiler generates dllimport-related | ||
// __imp_ stubs for them. This can lead to linker errors because the instrumentation | ||
// symbols have weak linkage or are in a comdat section, but the __imp_ stubs aren't. | ||
// Since profiler-related symbols were excluded from stub-generation in #59812, this has | ||
// been fixed, and this test checks that the llvm profile symbol appear, but without the | ||
// anomalous __imp_ stubs. | ||
// See https://github.com/rust-lang/rust/pull/59812 | ||
|
||
use run_make_support::{cwd, rfs, rustc}; | ||
|
||
fn main() { | ||
rustc() | ||
.input("test.rs") | ||
.emit("llvm-ir") | ||
.opt() | ||
.codegen_units(1) | ||
.profile_generate(cwd()) | ||
.arg("-Zno-profiler-runtime") | ||
.run(); | ||
let out = rfs::read_to_string("test.ll"); | ||
// We expect symbols starting with "__llvm_profile_". | ||
assert!(out.contains("__llvm_profile_")); | ||
// We do NOT expect the "__imp_" version of these symbols. | ||
assert!(!out.contains("__imp___llvm_profile_")); // 64 bit | ||
assert!(!out.contains("__imp____llvm_profile_")); // 32 bit | ||
} |