about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorb-naber <bn263@gmx.de>2022-02-09 14:21:49 +0100
committerb-naber <bn263@gmx.de>2022-02-15 21:17:49 +0100
commit54ff25e4467ad84f3f2e158b6969e5f71e72a287 (patch)
tree849b569f921fd721b3d6ef100a359fafa1bb3159 /src/test
parent22d6204db8c5919e8ef5801dd1049603999f9cfa (diff)
downloadrust-54ff25e4467ad84f3f2e158b6969e5f71e72a287.tar.gz
rust-54ff25e4467ad84f3f2e158b6969e5f71e72a287.zip
bless mir-opt tests
Diffstat (limited to 'src/test')
-rw-r--r--src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir45
-rw-r--r--src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir43
-rw-r--r--src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir35
-rw-r--r--src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir4
-rw-r--r--src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff4
-rw-r--r--src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir6
-rw-r--r--src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff6
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff4
9 files changed, 147 insertions, 4 deletions
diff --git a/src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir b/src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
index 9add3295212..1f1d857425e 100644
--- a/src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
+++ b/src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
@@ -19,3 +19,48 @@ fn main() -> () {
         return;                          // scope 0 at $DIR/const_allocation.rs:9:2: 9:2
     }
 }
+
+alloc1 (static: FOO, size: 16, align: 8) {
+    ╾───────alloc18───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
+}
+
+alloc18 (size: 72, align: 8) {
+    0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc5────────╼ │ ....░░░░╾──────╼
+    0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
+    0x20 │ ╾───────alloc9────────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
+    0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc14───────╼ │ ....*...╾──────╼
+    0x40 │ 03 00 00 00 00 00 00 00                         │ ........
+}
+
+alloc5 (size: 0, align: 8) {}
+
+alloc9 (size: 32, align: 8) {
+    0x00 │ ╾───────alloc8────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
+    0x10 │ ╾───────alloc10───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
+}
+
+alloc8 (size: 3, align: 1) {
+    66 6f 6f                                        │ foo
+}
+
+alloc10 (size: 3, align: 1) {
+    62 61 72                                        │ bar
+}
+
+alloc14 (size: 48, align: 8) {
+    0x00 │ ╾───────alloc13───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
+    0x10 │ ╾───────alloc15───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
+    0x20 │ ╾───────alloc16───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
+}
+
+alloc13 (size: 3, align: 1) {
+    6d 65 68                                        │ meh
+}
+
+alloc15 (size: 3, align: 1) {
+    6d 6f 70                                        │ mop
+}
+
+alloc16 (size: 4, align: 1) {
+    6d c3 b6 70                                     │ m..p
+}
diff --git a/src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir b/src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
index ef2618e457d..ef651f01c9b 100644
--- a/src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
+++ b/src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
@@ -19,3 +19,46 @@ fn main() -> () {
         return;                          // scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
     }
 }
+
+alloc1 (static: FOO, size: 16, align: 8) {
+    ╾───────alloc28───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
+}
+
+alloc28 (size: 72, align: 8) {
+    0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc13───────╼ │ ....░░░░╾──────╼
+    0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
+    0x20 │ ╾───────alloc18───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
+    0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc26───────╼ │ ....*...╾──────╼
+    0x40 │ 03 00 00 00 00 00 00 00                         │ ........
+}
+
+alloc13 (size: 0, align: 8) {}
+
+alloc18 (size: 16, align: 8) {
+    ╾───────alloc16───────╼ ╾───────alloc17───────╼ │ ╾──────╼╾──────╼
+}
+
+alloc16 (size: 1, align: 1) {
+    05                                              │ .
+}
+
+alloc17 (size: 1, align: 1) {
+    06                                              │ .
+}
+
+alloc26 (size: 24, align: 8) {
+    0x00 │ ╾─────alloc22+0x3─────╼ ╾───────alloc23───────╼ │ ╾──────╼╾──────╼
+    0x10 │ ╾─────alloc25+0x2─────╼                         │ ╾──────╼
+}
+
+alloc22 (size: 4, align: 1) {
+    2a 45 15 6f                                     │ *E.o
+}
+
+alloc23 (size: 1, align: 1) {
+    2a                                              │ *
+}
+
+alloc25 (size: 4, align: 1) {
+    2a 45 15 6f                                     │ *E.o
+}
diff --git a/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir b/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
index f3cbfcaca26..fb481697aa8 100644
--- a/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
+++ b/src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir
@@ -19,3 +19,38 @@ fn main() -> () {
         return;                          // scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
     }
 }
+
+alloc1 (static: FOO, size: 8, align: 8) {
+    ╾───────alloc11───────╼                         │ ╾──────╼
+}
+
+alloc11 (size: 180, align: 1) {
+    0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................
+    0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾──alloc6── │ ............╾───
+    0x20 │ ──────────╼ 01 ef cd ab 00 00 00 00 00 00 00 00 │ ───╼............
+    0x30 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x40 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x50 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x60 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x70 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x80 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ╾──── │ ..............╾─
+    0x90 │ ─────alloc8─────╼ 00 00 ╾─────alloc9+0x63─────╼ │ ─────╼..╾──────╼
+    0xa0 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0xb0 │ 00 00 00 00                                     │ ....
+}
+
+alloc6 (size: 4, align: 4) {
+    2a 00 00 00                                     │ *...
+}
+
+alloc8 (fn: main)
+
+alloc9 (size: 100, align: 1) {
+    0x00 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x20 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x30 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x40 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x50 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+    0x60 │ 00 00 00 00                                     │ ....
+}
diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
index c6b15174e46..666b805e822 100644
--- a/src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir
@@ -17,3 +17,7 @@ promoted[0] in BAR: &[&i32; 1] = {
         return;                          // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
     }
 }
+
+alloc1 (static: Y, size: 4, align: 4) {
+    2a 00 00 00                                     │ *...
+}
diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
index 84db15e1c8a..ad83e9c276e 100644
--- a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
+++ b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
@@ -49,5 +49,9 @@
       bb2 (cleanup): {
           resume;                          // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
       }
+- }
+- 
+- alloc1 (static: Y, size: 4, align: 4) {
+-     2a 00 00 00                                     │ *...
   }
   
diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
index 8bfdf1acaa9..785c8386e88 100644
--- a/src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir
@@ -7,13 +7,15 @@ promoted[0] in FOO: &[&i32; 1] = {
     let mut _3: *const i32;              // in scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
 
     bb0: {
-        _3 = const {alloc2: *const i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+        _3 = const {alloc3: *const i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
                                          // mir::Constant
                                          // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
-                                         // + literal: Const { ty: *const i32, val: Value(Scalar(alloc2)) }
+                                         // + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
         _2 = &(*_3);                     // scope 0 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
         _1 = [move _2];                  // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
         _0 = &_1;                        // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
         return;                          // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
     }
 }
+
+alloc3 (extern static: X)
diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
index 3f34c4982b2..a9cf3ca9767 100644
--- a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
+++ b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
@@ -18,14 +18,14 @@
 -         StorageLive(_3);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
 -         StorageLive(_4);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
 -         StorageLive(_5);                 // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
--         _5 = const {alloc2: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+-         _5 = const {alloc3: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
 +         _6 = const FOO::promoted[0];     // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
 +                                          // ty::Const
 +                                          // + ty: &[&i32; 1]
 +                                          // + val: Unevaluated(FOO, [], Some(promoted[0]))
                                            // mir::Constant
 -                                          // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
--                                          // + literal: Const { ty: *const i32, val: Value(Scalar(alloc2)) }
+-                                          // + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
 -         _4 = &(*_5);                     // scope 1 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
 -         _3 = [move _4];                  // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
 -         _2 = &_3;                        // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
@@ -52,4 +52,6 @@
           resume;                          // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
       }
   }
+- 
+- alloc3 (extern static: X)
   
diff --git a/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff b/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
index cee2d4c0c09..1fd92ddd461 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
@@ -42,3 +42,7 @@
       }
   }
   
+  alloc1 (static: STATIC, size: 4, align: 4) {
+      2a 00 00 00                                     │ *...
+  }
+  
diff --git a/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff b/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
index 7246b3bdb67..15b3e076642 100644
--- a/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
@@ -42,3 +42,7 @@
       }
   }
   
+  alloc1 (static: FOO, size: 1, align: 1) {
+      02                                              │ .
+  }
+