Skip to content

Commit

Permalink
Bless *all* the mir-opt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Aug 18, 2024
1 parent 249a36f commit 99cb0c6
Show file tree
Hide file tree
Showing 678 changed files with 3,567 additions and 3,567 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn address_of_reborrow() -> () {
StorageLive(_6);
_6 = &raw const (*_1);
AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] });
_5 = _6;
_5 = copy _6;
StorageDead(_6);
StorageDead(_5);
StorageLive(_7);
Expand All @@ -153,7 +153,7 @@ fn address_of_reborrow() -> () {
_9 = move _10 as *const dyn std::marker::Send (PointerCoercion(Unsize));
StorageDead(_10);
AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] });
_8 = _9;
_8 = copy _9;
StorageDead(_9);
StorageDead(_8);
StorageLive(_11);
Expand Down Expand Up @@ -194,7 +194,7 @@ fn address_of_reborrow() -> () {
StorageLive(_22);
_22 = &raw const (*_3);
AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] });
_21 = _22;
_21 = copy _22;
StorageDead(_22);
StorageDead(_21);
StorageLive(_23);
Expand All @@ -207,7 +207,7 @@ fn address_of_reborrow() -> () {
_25 = move _26 as *const dyn std::marker::Send (PointerCoercion(Unsize));
StorageDead(_26);
AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] });
_24 = _25;
_24 = copy _25;
StorageDead(_25);
StorageDead(_24);
StorageLive(_27);
Expand Down Expand Up @@ -242,7 +242,7 @@ fn address_of_reborrow() -> () {
StorageLive(_36);
_36 = &raw mut (*_3);
AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] });
_35 = _36;
_35 = copy _36;
StorageDead(_36);
StorageDead(_35);
StorageLive(_37);
Expand All @@ -255,7 +255,7 @@ fn address_of_reborrow() -> () {
_39 = move _40 as *mut dyn std::marker::Send (PointerCoercion(Unsize));
StorageDead(_40);
AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] });
_38 = _39;
_38 = copy _39;
StorageDead(_39);
StorageDead(_38);
StorageLive(_41);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ fn main() -> () {
StorageDead(_4);
StorageLive(_5);
StorageLive(_6);
_6 = _3;
_6 = copy _3;
_5 = foo(move _6) -> [return: bb1, unwind unreachable];
}

bb1: {
StorageDead(_6);
StorageLive(_7);
_7 = _2;
_7 = copy _2;
_8 = Len(_1);
_9 = Lt(_7, _8);
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable];
_9 = Lt(copy _7, copy _8);
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind unreachable];
}

bb2: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ fn main() -> () {
StorageDead(_4);
StorageLive(_5);
StorageLive(_6);
_6 = _3;
_6 = copy _3;
_5 = foo(move _6) -> [return: bb1, unwind continue];
}

bb1: {
StorageDead(_6);
StorageLive(_7);
_7 = _2;
_7 = copy _2;
_8 = Len(_1);
_9 = Lt(_7, _8);
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue];
_9 = Lt(copy _7, copy _8);
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind continue];
}

bb2: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yields ()

bb0: {
StorageLive(_3);
_3 = (_1.0: i32);
_3 = copy (_1.0: i32);
FakeRead(ForLet(None), _3);
StorageLive(_4);
_4 = &_3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yields ()

bb0: {
StorageLive(_3);
_3 = (_1.0: i32);
_3 = copy (_1.0: i32);
FakeRead(ForLet(None), _3);
StorageLive(_4);
_4 = &_3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yields ()

bb0: {
StorageLive(_3);
_3 = (_1.0: i32);
_3 = copy (_1.0: i32);
FakeRead(ForLet(None), _3);
StorageLive(_4);
_4 = &_3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yields ()

bb0: {
StorageLive(_3);
_3 = (_1.0: i32);
_3 = copy (_1.0: i32);
FakeRead(ForLet(None), _3);
StorageLive(_4);
_4 = &_3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10};

bb0: {
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) };
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) };
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r
let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10};

bb0: {
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) };
_0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) };
return;
}
}
2 changes: 1 addition & 1 deletion tests/mir-opt/basic_assignment.main.ElaborateDrops.diff
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
_1 = const false;
StorageLive(_2);
StorageLive(_3);
_3 = _1;
_3 = copy _1;
_2 = move _3;
StorageDead(_3);
StorageLive(_4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn main() -> () {
FakeRead(ForLet(None), _1);
StorageLive(_2);
StorageLive(_3);
_3 = _1;
_3 = copy _1;
_2 = move _3;
StorageDead(_3);
StorageLive(_4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
StorageLive(_13);
StorageLive(_14);
StorageLive(_15);
_15 = _38;
_15 = copy _38;
_14 = move _15;
goto -> bb6;
}
Expand Down Expand Up @@ -194,8 +194,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->

bb10: {
StorageLive(_17);
_17 = ((_9 as Ready).0: ());
_3 = _17;
_17 = copy ((_9 as Ready).0: ());
_3 = copy _17;
StorageDead(_17);
StorageDead(_14);
StorageDead(_12);
Expand Down Expand Up @@ -253,7 +253,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
StorageLive(_29);
StorageLive(_30);
StorageLive(_31);
_31 = _38;
_31 = copy _38;
_30 = move _31;
goto -> bb18;
}
Expand Down Expand Up @@ -291,8 +291,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->

bb21: {
StorageLive(_33);
_33 = ((_25 as Ready).0: ());
_37 = _33;
_33 = copy ((_25 as Ready).0: ());
_37 = copy _33;
StorageDead(_33);
StorageDead(_30);
StorageDead(_28);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ fn adt() -> Onion {
bb0: {
_1 = const 1_i32;
_2 = Foo { a: const 1_i32, b: const 2_i32 };
_3 = Bar::Foo(move _2, _1);
_0 = Onion { neon: ((_3 as variant#0).1: i32) };
_3 = Bar::Foo(move _2, copy _1);
_0 = Onion { neon: copy ((_3 as variant#0).1: i32) };
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn array() -> [i32; 2] {
bb0: {
_1 = [const 42_i32, const 43_i32];
_2 = const 1_i32;
_1 = [_2, const 2_i32];
_1 = [copy _2, const 2_i32];
_0 = move _1;
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ fn arbitrary_let(_1: i32) -> i32 {
let mut _3: i32;

bb0: {
_2 = _1;
_2 = copy _1;
goto -> bb2;
}

bb1: {
_0 = _3;
_0 = copy _3;
return;
}

bb2: {
_3 = _2;
_3 = copy _2;
goto -> bb1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn arrays() -> usize {
bb0: {
_1 = [const 5_i32; C];
_2 = Len(_1);
_0 = _2;
_0 = copy _2;
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn float_to_int(_1: f32) -> i32 {
let mut _0: i32;

bb0: {
_0 = _1 as i32 (FloatToInt);
_0 = copy _1 as i32 (FloatToInt);
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn int_to_int(_1: u32) -> i32 {
let mut _0: i32;

bb0: {
_0 = _1 as i32 (IntToInt);
_0 = copy _1 as i32 (IntToInt);
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn int_to_ptr(_1: usize) -> *const i32 {
let mut _0: *const i32;

bb0: {
_0 = _1 as *const i32 (PointerWithExposedProvenance);
_0 = copy _1 as *const i32 (PointerWithExposedProvenance);
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn assume_local(_1: bool) -> () {
let mut _0: ();

bb0: {
assume(_1);
assume(copy _1);
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn assume_place(_1: (bool, u8)) -> () {
let mut _0: ();

bb0: {
assume((_1.0: bool));
assume(copy (_1.0: bool));
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn switch_bool(_1: bool) -> u32 {
let mut _0: u32;

bb0: {
switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2];
switchInt(copy _1) -> [1: bb1, 0: bb2, otherwise: bb2];
}

bb1: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn switch_option(_1: Option<()>) -> bool {

bb0: {
_2 = discriminant(_1);
switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2];
switchInt(copy _2) -> [0: bb1, 1: bb2, otherwise: bb2];
}

bb1: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn switch_option_repr(_1: Bool) -> bool {

bb0: {
_2 = discriminant(_1);
switchInt(_2) -> [0: bb2, otherwise: bb1];
switchInt(copy _2) -> [0: bb2, otherwise: bb1];
}

bb1: {
Expand Down
40 changes: 20 additions & 20 deletions tests/mir-opt/building/custom/operators.f.built.after.mir
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ fn f(_1: i32, _2: bool) -> i32 {
let mut _3: (i32, bool);

bb0: {
_1 = Neg(_1);
_2 = Not(_2);
_1 = Add(_1, _1);
_1 = Sub(_1, _1);
_1 = Mul(_1, _1);
_1 = Div(_1, _1);
_1 = Rem(_1, _1);
_1 = BitXor(_1, _1);
_1 = BitAnd(_1, _1);
_1 = Shl(_1, _1);
_1 = Shr(_1, _1);
_2 = Eq(_1, _1);
_2 = Lt(_1, _1);
_2 = Le(_1, _1);
_2 = Ge(_1, _1);
_2 = Gt(_1, _1);
_3 = AddWithOverflow(_1, _1);
_2 = (_3.1: bool);
_1 = (_3.0: i32);
_0 = _1;
_1 = Neg(copy _1);
_2 = Not(copy _2);
_1 = Add(copy _1, copy _1);
_1 = Sub(copy _1, copy _1);
_1 = Mul(copy _1, copy _1);
_1 = Div(copy _1, copy _1);
_1 = Rem(copy _1, copy _1);
_1 = BitXor(copy _1, copy _1);
_1 = BitAnd(copy _1, copy _1);
_1 = Shl(copy _1, copy _1);
_1 = Shr(copy _1, copy _1);
_2 = Eq(copy _1, copy _1);
_2 = Lt(copy _1, copy _1);
_2 = Le(copy _1, copy _1);
_2 = Ge(copy _1, copy _1);
_2 = Gt(copy _1, copy _1);
_3 = AddWithOverflow(copy _1, copy _1);
_2 = copy (_3.1: bool);
_1 = copy (_3.0: i32);
_0 = copy _1;
return;
}
}
4 changes: 2 additions & 2 deletions tests/mir-opt/building/custom/operators.g.runtime.after.mir
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ fn g(_1: *const i32, _2: *const [i32]) -> () {
let mut _4: usize;

bb0: {
_3 = PtrMetadata(_1);
_4 = PtrMetadata(_2);
_3 = PtrMetadata(copy _1);
_4 = PtrMetadata(copy _2);
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn copy_for_deref(_1: (&i32, i32)) -> i32 {

bb0: {
_2 = deref_copy (_1.0: &i32);
_0 = (*_2);
_0 = copy (*_2);
return;
}
}
Loading

0 comments on commit 99cb0c6

Please sign in to comment.