summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff')
-rw-r--r--tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
new file mode 100644
index 000000000..ff23839e2
--- /dev/null
+++ b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
@@ -0,0 +1,58 @@
+- // MIR for `dont_remove_comparison` before SimplifyComparisonIntegral
++ // MIR for `dont_remove_comparison` after SimplifyComparisonIntegral
+
+ fn dont_remove_comparison(_1: i8) -> i32 {
+ debug a => _1; // in scope 0 at $DIR/if_condition_int.rs:+0:27: +0:28
+ let mut _0: i32; // return place in scope 0 at $DIR/if_condition_int.rs:+0:37: +0:40
+ let _2: bool; // in scope 0 at $DIR/if_condition_int.rs:+1:9: +1:10
+ let mut _3: i8; // in scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14
+ let mut _4: i32; // in scope 0 at $DIR/if_condition_int.rs:+3:23: +3:31
+ let mut _5: bool; // in scope 0 at $DIR/if_condition_int.rs:+3:23: +3:24
+ let mut _6: i32; // in scope 0 at $DIR/if_condition_int.rs:+4:23: +4:31
+ let mut _7: bool; // in scope 0 at $DIR/if_condition_int.rs:+4:23: +4:24
+ scope 1 {
+ debug b => _2; // in scope 1 at $DIR/if_condition_int.rs:+1:9: +1:10
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/if_condition_int.rs:+1:9: +1:10
+ StorageLive(_3); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14
+ _3 = _1; // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:14
+- _2 = Eq(move _3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20
+- StorageDead(_3); // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
+- switchInt(_2) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
++ _2 = Eq(_3, const 17_i8); // scope 0 at $DIR/if_condition_int.rs:+1:13: +1:20
++ nop; // scope 0 at $DIR/if_condition_int.rs:+1:19: +1:20
++ switchInt(move _3) -> [17: bb1, otherwise: bb2]; // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
+ }
+
+ bb1: {
++ StorageDead(_3); // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
+ StorageLive(_6); // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:31
+ StorageLive(_7); // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:24
+ _7 = _2; // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:24
+ _6 = move _7 as i32 (IntToInt); // scope 1 at $DIR/if_condition_int.rs:+4:23: +4:31
+ StorageDead(_7); // scope 1 at $DIR/if_condition_int.rs:+4:30: +4:31
+ _0 = Add(const 100_i32, move _6); // scope 1 at $DIR/if_condition_int.rs:+4:17: +4:31
+ StorageDead(_6); // scope 1 at $DIR/if_condition_int.rs:+4:30: +4:31
+ goto -> bb3; // scope 1 at $DIR/if_condition_int.rs:+4:30: +4:31
+ }
+
+ bb2: {
++ StorageDead(_3); // scope 1 at $DIR/if_condition_int.rs:+2:5: +2:12
+ StorageLive(_4); // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:31
+ StorageLive(_5); // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:24
+ _5 = _2; // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:24
+ _4 = move _5 as i32 (IntToInt); // scope 1 at $DIR/if_condition_int.rs:+3:23: +3:31
+ StorageDead(_5); // scope 1 at $DIR/if_condition_int.rs:+3:30: +3:31
+ _0 = Add(const 10_i32, move _4); // scope 1 at $DIR/if_condition_int.rs:+3:18: +3:31
+ StorageDead(_4); // scope 1 at $DIR/if_condition_int.rs:+3:30: +3:31
+ goto -> bb3; // scope 1 at $DIR/if_condition_int.rs:+3:30: +3:31
+ }
+
+ bb3: {
+ StorageDead(_2); // scope 0 at $DIR/if_condition_int.rs:+6:1: +6:2
+ return; // scope 0 at $DIR/if_condition_int.rs:+6:2: +6:2
+ }
+ }
+