about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2016-09-25 01:38:27 +0200
committerJonas Schievink <jonasschievink@gmail.com>2016-09-26 20:41:54 +0200
commit393db2d83089b3940fa2fe77f1241ca4625fe883 (patch)
tree49bcbec475b6668847f8af1d007f8f28e10102b2 /src/test
parent205dac935531aaf0a5b70898db28e1f1e5f86176 (diff)
downloadrust-393db2d83089b3940fa2fe77f1241ca4625fe883.tar.gz
rust-393db2d83089b3940fa2fe77f1241ca4625fe883.zip
[WIP] Move MIR towards a single kind of local
Diffstat (limited to 'src/test')
-rw-r--r--src/test/mir-opt/deaggregator_test.rs18
-rw-r--r--src/test/mir-opt/deaggregator_test_enum.rs16
-rw-r--r--src/test/mir-opt/storage_ranges.rs37
3 files changed, 36 insertions, 35 deletions
diff --git a/src/test/mir-opt/deaggregator_test.rs b/src/test/mir-opt/deaggregator_test.rs
index e57a9674cf6..66c3dfbf48c 100644
--- a/src/test/mir-opt/deaggregator_test.rs
+++ b/src/test/mir-opt/deaggregator_test.rs
@@ -23,19 +23,19 @@ fn main() {}
 // END RUST SOURCE
 // START rustc.node13.Deaggregator.before.mir
 // bb0: {
-//     var0 = arg0;                     // scope 0 at main.rs:8:8: 8:9
-//     tmp0 = var0;                     // scope 1 at main.rs:9:14: 9:15
-//     return = Baz { x: tmp0, y: const F32(0), z: const false }; // scope ...
+//     local2 = local1;                     // scope 0 at main.rs:8:8: 8:9
+//     local3 = local2;                     // scope 1 at main.rs:9:14: 9:15
+//     local0 = Baz { x: local3, y: const F32(0), z: const false }; // scope ...
 //     goto -> bb1;                     // scope 1 at main.rs:8:1: 10:2
 // }
 // END rustc.node13.Deaggregator.before.mir
 // START rustc.node13.Deaggregator.after.mir
 // bb0: {
-//     var0 = arg0;                     // scope 0 at main.rs:8:8: 8:9
-//     tmp0 = var0;                     // scope 1 at main.rs:9:14: 9:15
-//     (return.0: usize) = tmp0;        // scope 1 at main.rs:9:5: 9:34
-//     (return.1: f32) = const F32(0);  // scope 1 at main.rs:9:5: 9:34
-//     (return.2: bool) = const false;  // scope 1 at main.rs:9:5: 9:34
+//     local2 = local1;                     // scope 0 at main.rs:8:8: 8:9
+//     local3 = local2;                     // scope 1 at main.rs:9:14: 9:15
+//     (local0.0: usize) = local3;        // scope 1 at main.rs:9:5: 9:34
+//     (local0.1: f32) = const F32(0);  // scope 1 at main.rs:9:5: 9:34
+//     (local0.2: bool) = const false;  // scope 1 at main.rs:9:5: 9:34
 //     goto -> bb1;                     // scope 1 at main.rs:8:1: 10:2
 // }
-// END rustc.node13.Deaggregator.after.mir
\ No newline at end of file
+// END rustc.node13.Deaggregator.after.mir
diff --git a/src/test/mir-opt/deaggregator_test_enum.rs b/src/test/mir-opt/deaggregator_test_enum.rs
index ccfa760a28c..5d182f367b5 100644
--- a/src/test/mir-opt/deaggregator_test_enum.rs
+++ b/src/test/mir-opt/deaggregator_test_enum.rs
@@ -28,18 +28,18 @@ fn main() {
 // END RUST SOURCE
 // START rustc.node10.Deaggregator.before.mir
 // bb0: {
-//     var0 = arg0;                     // scope 0 at main.rs:7:8: 7:9
-//     tmp0 = var0;                     // scope 1 at main.rs:8:19: 8:20
-//     return = Baz::Foo { x: tmp0 };   // scope 1 at main.rs:8:5: 8:21
+//     local2 = local1;                     // scope 0 at main.rs:7:8: 7:9
+//     local3 = local2;                     // scope 1 at main.rs:8:19: 8:20
+//     local0 = Baz::Foo { x: local3 };   // scope 1 at main.rs:8:5: 8:21
 //     goto -> bb1;                     // scope 1 at main.rs:7:1: 9:2
 // }
 // END rustc.node10.Deaggregator.before.mir
 // START rustc.node10.Deaggregator.after.mir
 // bb0: {
-//     var0 = arg0;                     // scope 0 at main.rs:7:8: 7:9
-//     tmp0 = var0;                     // scope 1 at main.rs:8:19: 8:20
-//     ((return as Foo).0: usize) = tmp0; // scope 1 at main.rs:8:5: 8:21
-//     discriminant(return) = 1;         // scope 1 at main.rs:8:5: 8:21
+//     local2 = local1;                     // scope 0 at main.rs:7:8: 7:9
+//     local3 = local2;                     // scope 1 at main.rs:8:19: 8:20
+//     ((local0 as Foo).0: usize) = local3; // scope 1 at main.rs:8:5: 8:21
+//     discriminant(local0) = 1;         // scope 1 at main.rs:8:5: 8:21
 //     goto -> bb1;                     // scope 1 at main.rs:7:1: 9:2
 // }
-// END rustc.node10.Deaggregator.after.mir
\ No newline at end of file
+// END rustc.node10.Deaggregator.after.mir
diff --git a/src/test/mir-opt/storage_ranges.rs b/src/test/mir-opt/storage_ranges.rs
index 4ed0c8bc9ff..e2dd1bc3795 100644
--- a/src/test/mir-opt/storage_ranges.rs
+++ b/src/test/mir-opt/storage_ranges.rs
@@ -18,27 +18,28 @@ fn main() {
     let c = 1;
 }
 
+// TODO The StorageDead for local1 (a) after local6's (c) is missing!
+
 // END RUST SOURCE
 // START rustc.node4.TypeckMir.before.mir
 //     bb0: {
-//         StorageLive(var0);               // scope 0 at storage_ranges.rs:14:9: 14:10
-//         var0 = const 0i32;               // scope 0 at storage_ranges.rs:14:13: 14:14
-//         StorageLive(var1);               // scope 1 at storage_ranges.rs:16:13: 16:14
-//         StorageLive(tmp1);               // scope 1 at storage_ranges.rs:16:18: 16:25
-//         StorageLive(tmp2);               // scope 1 at storage_ranges.rs:16:23: 16:24
-//         tmp2 = var0;                     // scope 1 at storage_ranges.rs:16:23: 16:24
-//         tmp1 = std::option::Option<i32>::Some(tmp2,); // scope 1 at storage_ranges.rs:16:18: 16:25
-//         var1 = &tmp1;                    // scope 1 at storage_ranges.rs:16:17: 16:25
-//         StorageDead(tmp2);               // scope 1 at storage_ranges.rs:16:23: 16:24
-//         tmp0 = ();                       // scope 2 at storage_ranges.rs:15:5: 17:6
-//         StorageDead(tmp1);               // scope 1 at storage_ranges.rs:16:18: 16:25
-//         StorageDead(var1);               // scope 1 at storage_ranges.rs:16:13: 16:14
-//         StorageLive(var2);               // scope 1 at storage_ranges.rs:18:9: 18:10
-//         var2 = const 1i32;               // scope 1 at storage_ranges.rs:18:13: 18:14
-//         return = ();                     // scope 3 at storage_ranges.rs:13:11: 19:2
-//         StorageDead(var2);               // scope 1 at storage_ranges.rs:18:9: 18:10
-//         StorageDead(var0);               // scope 0 at storage_ranges.rs:14:9: 14:10
-//         goto -> bb1;                     // scope 0 at storage_ranges.rs:13:1: 19:2
+//         StorageLive(local1);             // scope 0 at storage_ranges.rs:12:9: 12:10
+//         local1 = const 0i32;             // scope 0 at storage_ranges.rs:12:13: 12:14
+//         StorageLive(local3);             // scope 1 at storage_ranges.rs:14:13: 14:14
+//         StorageLive(local4);             // scope 1 at storage_ranges.rs:14:18: 14:25
+//         StorageLive(local5);             // scope 1 at storage_ranges.rs:14:23: 14:24
+//         local5 = local1;                 // scope 1 at storage_ranges.rs:14:23: 14:24
+//         local4 = std::option::Option<i32>::Some(local5,); // scope 1 at storage_ranges.rs:14:18: 14:25
+//         local3 = &local4;                // scope 1 at storage_ranges.rs:14:17: 14:25
+//         StorageDead(local5);             // scope 1 at storage_ranges.rs:14:23: 14:24
+//         local2 = ();                     // scope 2 at storage_ranges.rs:13:5: 15:6
+//         StorageDead(local4);             // scope 1 at storage_ranges.rs:14:18: 14:25
+//         StorageDead(local3);             // scope 1 at storage_ranges.rs:14:13: 14:14
+//         StorageLive(local6);             // scope 1 at storage_ranges.rs:16:9: 16:10
+//         local6 = const 1i32;             // scope 1 at storage_ranges.rs:16:13: 16:14
+//         local0 = ();                     // scope 3 at storage_ranges.rs:11:11: 17:2
+//         StorageDead(local6);             // scope 1 at storage_ranges.rs:16:9: 16:10
+//         goto -> bb1;                     // scope 0 at storage_ranges.rs:11:1: 17:2
 //     }
 //
 //     bb1: {