about summary refs log tree commit diff
path: root/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff')
-rw-r--r--tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
new file mode 100644
index 00000000000..f9e22866bee
--- /dev/null
+++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
@@ -0,0 +1,38 @@
+- // MIR for `main` before SimplifyConstCondition-after-const-prop
++ // MIR for `main` after SimplifyConstCondition-after-const-prop
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/simplify_if.rs:+0:11: +0:11
+      let mut _1: bool;                    // in scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
+      let _2: ();                          // in scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
+          _1 = const false;                // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
+-         switchInt(const false) -> [0: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
++         goto -> bb3;                     // scope 0 at $DIR/simplify_if.rs:+1:8: +1:13
+      }
+  
+      bb1: {
+          StorageLive(_2);                 // scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
+          _2 = noop() -> bb2;              // scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
+                                           // mir::Constant
+                                           // + span: $DIR/simplify_if.rs:7:9: 7:13
+                                           // + literal: Const { ty: fn() {noop}, val: Value(<ZST>) }
+      }
+  
+      bb2: {
+          StorageDead(_2);                 // scope 0 at $DIR/simplify_if.rs:+2:15: +2:16
+          goto -> bb4;                     // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6
+      }
+  
+      bb3: {
+          goto -> bb4;                     // scope 0 at $DIR/simplify_if.rs:+1:5: +3:6
+      }
+  
+      bb4: {
+          StorageDead(_1);                 // scope 0 at $DIR/simplify_if.rs:+3:5: +3:6
+          return;                          // scope 0 at $DIR/simplify_if.rs:+4:2: +4:2
+      }
+  }
+