Skip to content

Commit

Permalink
Bless mir-opt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Jan 7, 2022
1 parent da1b320 commit 595657d
Show file tree
Hide file tree
Showing 14 changed files with 265 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
static mut BAR: *const &i32 = {
let mut _0: *const &i32; // return place in scope 0 at $DIR/const-promotion-extern-static.rs:9:17: 9:28
let mut _1: &[&i32]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
let mut _2: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
let _3: [&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
let mut _4: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
let _5: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+ let mut _6: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
let _2: &[&i32]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
let mut _3: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
let _4: [&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
let mut _5: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
let _6: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+ let mut _7: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44

bb0: {
StorageLive(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
StorageLive(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
- StorageLive(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
- _5 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+ _6 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
StorageLive(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
- StorageLive(_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
- _6 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+ _7 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
// ty::Const
- // + ty: &i32
- // + val: Value(Scalar(alloc1))
Expand All @@ -26,24 +28,26 @@
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
- _4 = &(*_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
- _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
- _5 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
- _4 = [move _5]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
- _3 = &_4; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
+ // + span: $DIR/const-promotion-extern-static.rs:9:31: 9:44
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:6 ~ const_promotion_extern_static[HASH]::BAR), const_param_did: None }, substs_: Some([]), promoted: Some(promoted[0]) }) }
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
- StorageDead(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:9:34: 9:35
StorageDead(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:9:34: 9:35
+ _3 = &(*_7); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
_2 = move _3 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
_1 = &(*_2); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:34: 9:35
StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:34: 9:35
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:9:36: 9:42
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
}

bb1: {
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
- StorageDead(_6); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
- StorageDead(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
StorageDead(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@
static mut FOO: *const &i32 = {
let mut _0: *const &i32; // return place in scope 0 at $DIR/const-promotion-extern-static.rs:13:17: 13:28
let mut _1: &[&i32]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
let mut _2: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
let _3: [&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
let mut _4: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
let _5: *const i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+ let mut _6: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
let _2: &[&i32]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
let mut _3: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
let _4: [&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
let mut _5: &i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
let _6: *const i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+ let mut _7: &[&i32; 1]; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
scope 1 {
}

bb0: {
StorageLive(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
StorageLive(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
- 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 {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
StorageLive(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
- StorageLive(_6); // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
- _6 = const {alloc3: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+ _7 = const FOO::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
// ty::Const
- // + ty: *const i32
- // + val: Value(Scalar(alloc3))
Expand All @@ -28,24 +30,26 @@
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
- // + 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
- _5 = &(*_6); // scope 1 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
- _4 = [move _5]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
- _3 = &_4; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
+ // + span: $DIR/const-promotion-extern-static.rs:13:31: 13:55
+ // + literal: Const { ty: &[&i32; 1], val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:7 ~ const_promotion_extern_static[HASH]::FOO), const_param_did: None }, substs_: Some([]), promoted: Some(promoted[0]) }) }
+ _2 = &(*_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
_1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
- StorageDead(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:13:45: 13:46
StorageDead(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:13:45: 13:46
+ _3 = &(*_7); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
_2 = move _3 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
_1 = &(*_2); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:45: 13:46
StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:45: 13:46
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:13:47: 13:53
// + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(Scalar(<ZST>)) }
}

bb1: {
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
- StorageDead(_6); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
- StorageDead(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
StorageDead(_2); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
}
Expand Down
44 changes: 22 additions & 22 deletions src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
let mut _4: usize; // in scope 0 at $DIR/lower_array_len.rs:7:8: 7:13
let mut _5: usize; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
let mut _7: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20
let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
let _7: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
let mut _8: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
let _9: usize; // in scope 0 at $DIR/lower_array_len.rs:8:15: 8:20
let mut _10: usize; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
let mut _11: bool; // in scope 0 at $DIR/lower_array_len.rs:8:9: 8:21

bb0: {
StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27
Expand All @@ -22,34 +22,34 @@
StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
- _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
+ _7 = _2; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
_11 = _7; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
_6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21
- _5 = Len((*_11)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
+ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
- _8 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
+ _8 = _2; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
_7 = move _8 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
- _6 = &(*_7); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
+ _6 = _7; // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:7:20: 7:21
_5 = Len((*_6)); // scope 0 at $DIR/lower_array_len.rs:7:16: 7:27
StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27
_3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27
StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27
StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27
StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:7:26: 7:27
switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:7:8: 7:27
}

bb1: {
StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20
_8 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20
- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
+ _9 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
_10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
StorageLive(_9); // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20
_9 = _1; // scope 0 at $DIR/lower_array_len.rs:8:15: 8:20
- _10 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
+ _10 = const N; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
_11 = Lt(_9, _10); // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
assert(move _11, "index out of bounds: the length is {} but the index is {}", move _10, _9) -> bb2; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
}

bb2: {
_0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6
_0 = (*_2)[_9]; // scope 0 at $DIR/lower_array_len.rs:8:9: 8:21
StorageDead(_9); // scope 0 at $DIR/lower_array_len.rs:9:5: 9:6
goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:7:5: 11:6
}

Expand Down
Loading

0 comments on commit 595657d

Please sign in to comment.