about summary refs log tree commit diff
path: root/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
diff options
context:
space:
mode:
authorPietro Albini <pietro.albini@ferrous-systems.com>2023-06-08 09:34:53 +0200
committerPietro Albini <pietro.albini@ferrous-systems.com>2023-06-12 09:34:17 +0200
commit466812394508495935ff3eb57152ce231a3635eb (patch)
tree244824425c21eccf1fab9ee02be3ad111a77adf9 /tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
parent070cc836e95517fff04699ceb9f85ec017befc58 (diff)
downloadrust-466812394508495935ff3eb57152ce231a3635eb.tar.gz
rust-466812394508495935ff3eb57152ce231a3635eb.zip
bless mir-opt
To reproduce the changes in this commit locally:

- Run `./x test tidy` and remove all the output files not associated
  with a test file anymore, as reported by tidy.
- Run `./x test tests/mir-opt --bless` to generate the new outputs.
Diffstat (limited to 'tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff')
-rw-r--r--tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
new file mode 100644
index 00000000000..2159f9dd6cc
--- /dev/null
+++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff
@@ -0,0 +1,36 @@
+- // 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: {
+          _2 = noop() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/simplify_if.rs:+2:9: +2:15
+                                           // mir::Constant
+                                           // + span: $DIR/simplify_if.rs:8:9: 8:13
+                                           // + literal: Const { ty: fn() {noop}, val: Value(<ZST>) }
+      }
+  
+      bb2: {
+          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
+      }
+  }
+