forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#77577 - Mark-Simulacrum:stable-next, r=pietro…
…albini [stable] 1.47 release This PR includes backports of: * Fix miscompile in SimplifyBranchSame rust-lang#77549 * Force posix-style quoting on lld, independent of host platform rust-lang#77543 Note that both are still beta-nominated/beta-accepted, as they need to be backported to 1.48 as well (future beta branch).
- Loading branch information
Showing
5 changed files
with
170 additions
and
4 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
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,21 @@ | ||
// Regression test for SimplifyBranchSame miscompilation. | ||
// run-pass | ||
|
||
macro_rules! m { | ||
($a:expr, $b:expr, $c:block) => { | ||
match $a { | ||
Lto::Fat | Lto::Thin => { $b; (); $c } | ||
Lto::No => { $b; () } | ||
} | ||
} | ||
} | ||
|
||
pub enum Lto { No, Thin, Fat } | ||
|
||
fn f(mut cookie: u32, lto: Lto) -> u32 { | ||
let mut _a = false; | ||
m!(lto, _a = true, {cookie = 0}); | ||
cookie | ||
} | ||
|
||
fn main() { assert_eq!(f(42, Lto::Thin), 0) } |