We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1240817 commit 2d8cf77Copy full SHA for 2d8cf77
src/test/ui/mir/simplify-branch-same.rs
@@ -0,0 +1,21 @@
1
+// Regression test for SimplifyBranchSame miscompilation.
2
+// run-pass
3
+
4
+macro_rules! m {
5
+ ($a:expr, $b:expr, $c:block) => {
6
+ match $a {
7
+ Lto::Fat | Lto::Thin => { $b; (); $c }
8
+ Lto::No => { $b; () }
9
+ }
10
11
+}
12
13
+pub enum Lto { No, Thin, Fat }
14
15
+fn f(mut cookie: u32, lto: Lto) -> u32 {
16
+ let mut _a = false;
17
+ m!(lto, _a = true, {cookie = 0});
18
+ cookie
19
20
21
+fn main() { assert_eq!(f(42, Lto::Thin), 0) }
0 commit comments