forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run name-anon-globals after LTO passes as well
If we're going to emit bitcode (through ThinLTOBuffer), then we need to ensure that anon globals are named. This was already done after optimization passes, but also has to happen after LTO passes, as we always emit the final result in a ThinLTO-compatible manner. Fixes rust-lang#51947.
- Loading branch information
Showing
3 changed files
with
30 additions
and
2 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 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 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,17 @@ | ||
// compile-pass | ||
|
||
#![crate_type = "lib"] | ||
#![feature(linkage)] | ||
|
||
// MergeFunctions will merge these via an anonymous internal | ||
// backing function, which must be named if ThinLTO buffers are used | ||
|
||
#[linkage = "weak"] | ||
pub fn fn1(a: u32, b: u32, c: u32) -> u32 { | ||
a + b + c | ||
} | ||
|
||
#[linkage = "weak"] | ||
pub fn fn2(a: u32, b: u32, c: u32) -> u32 { | ||
a + b + c | ||
} |