about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-12-04 19:38:46 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-12-25 18:01:07 +0000
commit22e9e52c842a1fe4e259e8ac74f0388afdc29e28 (patch)
tree6362f4bce3076922f0c5ef7f3ea18d049bb83c7c
parentd9ee0f468f8d07e92da94fe991db91e95822d721 (diff)
downloadrust-22e9e52c842a1fe4e259e8ac74f0388afdc29e28.tar.gz
rust-22e9e52c842a1fe4e259e8ac74f0388afdc29e28.zip
Make tests unit.
-rw-r--r--src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir4
-rw-r--r--src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir4
-rw-r--r--src/test/mir-opt/const_allocation.rs1
-rw-r--r--src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir4
-rw-r--r--src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir4
-rw-r--r--src/test/mir-opt/const_allocation2.rs1
-rw-r--r--src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir4
-rw-r--r--src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir4
-rw-r--r--src/test/mir-opt/const_allocation3.rs1
-rw-r--r--src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff2
-rw-r--r--src/test/mir-opt/const_prop/ref_deref.rs1
-rw-r--r--src/test/mir-opt/const_prop/ref_deref_project.rs2
-rw-r--r--src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff2
-rw-r--r--src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff2
-rw-r--r--src/test/mir-opt/const_prop/slice_len.rs1
16 files changed, 22 insertions, 17 deletions
diff --git a/src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir b/src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
index da5a64cac65..6140fc52f65 100644
--- a/src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
+++ b/src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
@@ -10,12 +10,12 @@ fn main() -> () {
         StorageLive(_2);                 // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
         _2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
                                          // mir::Constant
-                                         // + span: $DIR/const_allocation.rs:8:5: 8:8
+                                         // + span: $DIR/const_allocation.rs:9:5: 9:8
                                          // + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
         _1 = (*_2);                      // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
         StorageDead(_2);                 // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
         StorageDead(_1);                 // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
-        nop;                             // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
+        _0 = const ();                   // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
         return;                          // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
     }
 }
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 febd990681e..b2ed23c6873 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
@@ -10,12 +10,12 @@ fn main() -> () {
         StorageLive(_2);                 // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
         _2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
                                          // mir::Constant
-                                         // + span: $DIR/const_allocation.rs:8:5: 8:8
+                                         // + span: $DIR/const_allocation.rs:9:5: 9:8
                                          // + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
         _1 = (*_2);                      // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
         StorageDead(_2);                 // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
         StorageDead(_1);                 // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
-        nop;                             // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
+        _0 = const ();                   // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
         return;                          // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
     }
 }
diff --git a/src/test/mir-opt/const_allocation.rs b/src/test/mir-opt/const_allocation.rs
index b0fcb86fcee..91a2455eb83 100644
--- a/src/test/mir-opt/const_allocation.rs
+++ b/src/test/mir-opt/const_allocation.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
 // ignore-endian-big
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 static FOO: &[(Option<i32>, &[&str])] =
diff --git a/src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir b/src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
index 389641f20f4..aab005c52d6 100644
--- a/src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
+++ b/src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
@@ -10,12 +10,12 @@ fn main() -> () {
         StorageLive(_2);                 // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
         _2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
                                          // mir::Constant
-                                         // + span: $DIR/const_allocation2.rs:5:5: 5:8
+                                         // + span: $DIR/const_allocation2.rs:6:5: 6:8
                                          // + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
         _1 = (*_2);                      // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
         StorageDead(_2);                 // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
         StorageDead(_1);                 // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
-        nop;                             // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
+        _0 = const ();                   // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
         return;                          // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
     }
 }
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 ce3848e9216..0eff9474c20 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
@@ -10,12 +10,12 @@ fn main() -> () {
         StorageLive(_2);                 // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
         _2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
                                          // mir::Constant
-                                         // + span: $DIR/const_allocation2.rs:5:5: 5:8
+                                         // + span: $DIR/const_allocation2.rs:6:5: 6:8
                                          // + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
         _1 = (*_2);                      // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
         StorageDead(_2);                 // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
         StorageDead(_1);                 // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
-        nop;                             // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
+        _0 = const ();                   // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
         return;                          // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
     }
 }
diff --git a/src/test/mir-opt/const_allocation2.rs b/src/test/mir-opt/const_allocation2.rs
index 30afedffb39..f2870aa47c5 100644
--- a/src/test/mir-opt/const_allocation2.rs
+++ b/src/test/mir-opt/const_allocation2.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
 // ignore-endian-big
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 // EMIT_MIR const_allocation2.main.ConstProp.after.mir
diff --git a/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir b/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
index b72519159d7..55c6db5d0ce 100644
--- a/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
+++ b/src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir
@@ -10,12 +10,12 @@ fn main() -> () {
         StorageLive(_2);                 // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
         _2 = const {alloc1: &&Packed};   // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
                                          // mir::Constant
-                                         // + span: $DIR/const_allocation3.rs:5:5: 5:8
+                                         // + span: $DIR/const_allocation3.rs:6:5: 6:8
                                          // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
         _1 = (*_2);                      // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
         StorageDead(_2);                 // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
         StorageDead(_1);                 // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
-        nop;                             // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
+        _0 = const ();                   // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
         return;                          // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
     }
 }
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 6bd047c7d9f..27492a7fd22 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
@@ -10,12 +10,12 @@ fn main() -> () {
         StorageLive(_2);                 // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
         _2 = const {alloc1: &&Packed};   // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
                                          // mir::Constant
-                                         // + span: $DIR/const_allocation3.rs:5:5: 5:8
+                                         // + span: $DIR/const_allocation3.rs:6:5: 6:8
                                          // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
         _1 = (*_2);                      // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
         StorageDead(_2);                 // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
         StorageDead(_1);                 // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
-        nop;                             // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
+        _0 = const ();                   // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
         return;                          // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
     }
 }
diff --git a/src/test/mir-opt/const_allocation3.rs b/src/test/mir-opt/const_allocation3.rs
index ddeb32ab9a5..da3fd089b02 100644
--- a/src/test/mir-opt/const_allocation3.rs
+++ b/src/test/mir-opt/const_allocation3.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
 // ignore-endian-big
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 // EMIT_MIR const_allocation3.main.ConstProp.after.mir
diff --git a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
index 09ce67ff15d..8a73f0390e1 100644
--- a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
@@ -13,7 +13,7 @@
           StorageLive(_2);                 // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
           _4 = const _;                    // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
                                            // mir::Constant
-                                           // + span: $DIR/ref_deref.rs:5:6: 5:10
+                                           // + span: $DIR/ref_deref.rs:6:6: 6:10
                                            // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
           _2 = _4;                         // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
 -         _1 = (*_2);                      // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
diff --git a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
index 902cd785031..015ec4d078c 100644
--- a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
+++ b/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
@@ -16,7 +16,7 @@
 -         _2 = &_3;                        // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
 +         _4 = const _;                    // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
 +                                          // mir::Constant
-+                                          // + span: $DIR/ref_deref.rs:5:6: 5:10
++                                          // + span: $DIR/ref_deref.rs:6:6: 6:10
 +                                          // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
 +         _2 = &(*_4);                     // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
           _1 = (*_2);                      // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
diff --git a/src/test/mir-opt/const_prop/ref_deref.rs b/src/test/mir-opt/const_prop/ref_deref.rs
index 30ec9766367..d2549c8b6aa 100644
--- a/src/test/mir-opt/const_prop/ref_deref.rs
+++ b/src/test/mir-opt/const_prop/ref_deref.rs
@@ -1,3 +1,4 @@
+// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
 // EMIT_MIR ref_deref.main.PromoteTemps.diff
 // EMIT_MIR ref_deref.main.ConstProp.diff
 
diff --git a/src/test/mir-opt/const_prop/ref_deref_project.rs b/src/test/mir-opt/const_prop/ref_deref_project.rs
index 659c11d9b0c..2fdd4e15319 100644
--- a/src/test/mir-opt/const_prop/ref_deref_project.rs
+++ b/src/test/mir-opt/const_prop/ref_deref_project.rs
@@ -1,4 +1,4 @@
-// unit-test
+// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
 // EMIT_MIR ref_deref_project.main.PromoteTemps.diff
 // EMIT_MIR ref_deref_project.main.ConstProp.diff
 
diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
index 44445731e72..9017fd18e48 100644
--- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
+++ b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
@@ -20,7 +20,7 @@
           StorageLive(_4);                 // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
           _9 = const _;                    // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
                                            // mir::Constant
-                                           // + span: $DIR/slice_len.rs:5:6: 5:19
+                                           // + span: $DIR/slice_len.rs:6:6: 6:19
                                            // + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
           _4 = _9;                         // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
           _3 = _4;                         // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
index 44445731e72..9017fd18e48 100644
--- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
+++ b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
@@ -20,7 +20,7 @@
           StorageLive(_4);                 // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
           _9 = const _;                    // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
                                            // mir::Constant
-                                           // + span: $DIR/slice_len.rs:5:6: 5:19
+                                           // + span: $DIR/slice_len.rs:6:6: 6:19
                                            // + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
           _4 = _9;                         // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
           _3 = _4;                         // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
diff --git a/src/test/mir-opt/const_prop/slice_len.rs b/src/test/mir-opt/const_prop/slice_len.rs
index fa9eafa8b0b..eaaf34b960e 100644
--- a/src/test/mir-opt/const_prop/slice_len.rs
+++ b/src/test/mir-opt/const_prop/slice_len.rs
@@ -1,3 +1,4 @@
+// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 
 // EMIT_MIR slice_len.main.ConstProp.diff