From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- src/test/mir-opt/dest-prop/branch.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/test/mir-opt/dest-prop/branch.rs') diff --git a/src/test/mir-opt/dest-prop/branch.rs b/src/test/mir-opt/dest-prop/branch.rs index fffcf82b3..898c908b1 100644 --- a/src/test/mir-opt/dest-prop/branch.rs +++ b/src/test/mir-opt/dest-prop/branch.rs @@ -1,5 +1,5 @@ //! Tests that assignment in both branches of an `if` are eliminated. -// compile-flags: -Zunsound-mir-opts +// unit-test: DestinationPropagation fn val() -> i32 { 1 } @@ -8,8 +8,8 @@ fn cond() -> bool { true } -// EMIT_MIR branch.main.DestinationPropagation.diff -fn main() { +// EMIT_MIR branch.foo.DestinationPropagation.diff +fn foo() -> i32 { let x = val(); let y = if cond() { @@ -18,4 +18,10 @@ fn main() { val(); x }; + + y +} + +fn main() { + foo(); } -- cgit v1.2.3