Skip to content

Commit

Permalink
bless mir opt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Apr 13, 2020
1 parent db83fdc commit 4714e20
Show file tree
Hide file tree
Showing 70 changed files with 730 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ fn address_of_reborrow() -> () {
StorageDead(_48); // bb0[157]: scope 13 at $DIR/address-of.rs:36:25: 36:26
FakeRead(ForLet, _47); // bb0[158]: scope 13 at $DIR/address-of.rs:36:9: 36:10
AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // bb0[159]: scope 13 at $DIR/address-of.rs:36:12: 36:22
_0 = (); // bb0[160]: scope 0 at $DIR/address-of.rs:3:26: 37:2
_0 = const (); // bb0[160]: scope 0 at $DIR/address-of.rs:3:26: 37:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/address-of.rs:3:26: 37:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_47); // bb0[161]: scope 13 at $DIR/address-of.rs:37:1: 37:2
StorageDead(_45); // bb0[162]: scope 12 at $DIR/address-of.rs:37:1: 37:2
StorageDead(_44); // bb0[163]: scope 11 at $DIR/address-of.rs:37:1: 37:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ fn borrow_and_cast(_1: i32) -> () {
_6 = &raw mut (*_7); // bb0[15]: scope 2 at $DIR/address-of.rs:44:13: 44:19
FakeRead(ForLet, _6); // bb0[16]: scope 2 at $DIR/address-of.rs:44:9: 44:10
StorageDead(_7); // bb0[17]: scope 2 at $DIR/address-of.rs:44:31: 44:32
_0 = (); // bb0[18]: scope 0 at $DIR/address-of.rs:41:32: 45:2
_0 = const (); // bb0[18]: scope 0 at $DIR/address-of.rs:41:32: 45:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/address-of.rs:41:32: 45:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_6); // bb0[19]: scope 2 at $DIR/address-of.rs:45:1: 45:2
StorageDead(_4); // bb0[20]: scope 1 at $DIR/address-of.rs:45:1: 45:2
StorageDead(_2); // bb0[21]: scope 0 at $DIR/address-of.rs:45:1: 45:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ fn main() -> () {
_1[_7] = move _5; // bb2[0]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
StorageDead(_5); // bb2[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
StorageDead(_7); // bb2[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
_0 = (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
_0 = const (); // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:12:11: 17:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_3); // bb2[4]: scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
StorageDead(_2); // bb2[5]: scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
StorageDead(_1); // bb2[6]: scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ fn main() -> () {

bb6: {
StorageDead(_6); // bb6[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
_0 = (); // bb6[1]: scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
_0 = const (); // bb6[1]: scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/basic_assignment.rs:10:11: 24:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
drop(_5) -> [return: bb7, unwind: bb3]; // bb6[2]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ fn main() -> () {
bb5: {
StorageDead(_4); // bb5[0]: scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_3); // bb5[1]: scope 1 at $DIR/box_expr.rs:8:12: 8:13
_0 = (); // bb5[2]: scope 0 at $DIR/box_expr.rs:6:11: 9:2
_0 = const (); // bb5[2]: scope 0 at $DIR/box_expr.rs:6:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/box_expr.rs:6:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
drop(_1) -> bb8; // bb5[3]: scope 0 at $DIR/box_expr.rs:9:1: 9:2
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ fn main() -> () {
// mir::Constant
// + span: $DIR/byte_slice.rs:6:19: 6:23
// + literal: Const { ty: u8, val: Value(Scalar(0x78)) }
_0 = (); // bb0[4]: scope 0 at $DIR/byte_slice.rs:4:11: 7:2
_0 = const (); // bb0[4]: scope 0 at $DIR/byte_slice.rs:4:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/byte_slice.rs:4:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_2); // bb0[5]: scope 1 at $DIR/byte_slice.rs:7:1: 7:2
StorageDead(_1); // bb0[6]: scope 0 at $DIR/byte_slice.rs:7:1: 7:2
return; // bb0[7]: scope 0 at $DIR/byte_slice.rs:7:2: 7:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ fn main() -> () {
_1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
_0 = (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2
_0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation.rs:7:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
return; // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ fn main() -> () {
_1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
_0 = (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
_0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation2.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
return; // bb0[7]: scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ fn main() -> () {
_1 = (*_2); // bb0[3]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
StorageDead(_2); // bb0[4]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
StorageDead(_1); // bb0[5]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
_0 = (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
_0 = const (); // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_allocation3.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
return; // bb0[7]: scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@
+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_2); // bb0[6]: scope 0 at $DIR/aggregate.rs:5:27: 5:28
StorageDead(_3); // bb0[7]: scope 0 at $DIR/aggregate.rs:5:28: 5:29
_0 = (); // bb0[8]: scope 0 at $DIR/aggregate.rs:4:11: 6:2
_0 = const (); // bb0[8]: scope 0 at $DIR/aggregate.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/aggregate.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_1); // bb0[9]: scope 0 at $DIR/aggregate.rs:6:1: 6:2
return; // bb0[10]: scope 0 at $DIR/aggregate.rs:6:2: 6:2
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageDead(_3); // bb1[1]: scope 0 at $DIR/array_index.rs:5:33: 5:34
StorageDead(_2); // bb1[2]: scope 0 at $DIR/array_index.rs:5:33: 5:34
_0 = (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2
_0 = const (); // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/array_index.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_1); // bb1[4]: scope 0 at $DIR/array_index.rs:6:1: 6:2
return; // bb1[5]: scope 0 at $DIR/array_index.rs:6:2: 6:2
}
Expand Down
8 changes: 7 additions & 1 deletion src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@

bb2: {
StorageDead(_3); // bb2[0]: scope 0 at $DIR/boxes.rs:12:26: 12:27
_0 = (); // bb2[1]: scope 0 at $DIR/boxes.rs:11:11: 13:2
_0 = const (); // bb2[1]: scope 0 at $DIR/boxes.rs:11:11: 13:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/boxes.rs:11:11: 13:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_1); // bb2[2]: scope 0 at $DIR/boxes.rs:13:1: 13:2
return; // bb2[3]: scope 0 at $DIR/boxes.rs:13:2: 13:2
}
Expand Down
8 changes: 7 additions & 1 deletion src/test/mir-opt/const_prop/cast/rustc.main.ConstProp.diff
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@
+ // mir::Constant
+ // + span: $DIR/cast.rs:6:13: 6:24
+ // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
_0 = (); // bb0[4]: scope 0 at $DIR/cast.rs:3:11: 7:2
_0 = const (); // bb0[4]: scope 0 at $DIR/cast.rs:3:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/cast.rs:3:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_2); // bb0[5]: scope 1 at $DIR/cast.rs:7:1: 7:2
StorageDead(_1); // bb0[6]: scope 0 at $DIR/cast.rs:7:1: 7:2
return; // bb0[7]: scope 0 at $DIR/cast.rs:7:2: 7:2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@
+ // mir::Constant
+ // + span: $DIR/checked_add.rs:5:18: 5:23
+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
_0 = (); // bb1[1]: scope 0 at $DIR/checked_add.rs:4:11: 6:2
_0 = const (); // bb1[1]: scope 0 at $DIR/checked_add.rs:4:11: 6:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/checked_add.rs:4:11: 6:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_1); // bb1[2]: scope 0 at $DIR/checked_add.rs:6:1: 6:2
return; // bb1[3]: scope 0 at $DIR/checked_add.rs:6:2: 6:2
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
bb1: {
StorageDead(_5); // bb1[0]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:11: 8:12
StorageDead(_4); // bb1[1]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:12: 8:13
_0 = (); // bb1[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
_0 = const (); // bb1[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_1); // bb1[3]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:1: 9:2
return; // bb1[4]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:2: 9:2
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
}

bb1: {
_0 = (); // bb1[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
_0 = const (); // bb1[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/control-flow-simplification.rs:12:5: 14:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_1); // bb1[1]: scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2
return; // bb1[2]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ fn hello() -> () {
let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14

bb0: {
return; // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
_0 = const (); // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/control-flow-simplification.rs:12:5: 14:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
return; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_2); // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68
StorageDead(_3); // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69
_0 = (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2
_0 = const (); // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/discriminant.rs:5:11: 7:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_1); // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2
return; // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2
}
Expand Down
Loading

0 comments on commit 4714e20

Please sign in to comment.