Update mir-opt test suite

This commit is contained in:
Rémy Rakic
2018-09-15 01:05:29 +02:00
committed by Remy Rakic
parent 75b94e24bf
commit e90c942477
22 changed files with 48 additions and 13 deletions

View File

@@ -47,6 +47,7 @@ fn main() {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = const false; // _1 = const false;
// FakeRead(ForLet, _1);
// StorageLive(_2); // StorageLive(_2);
// StorageLive(_3); // StorageLive(_3);
// _3 = _1; // _3 = _1;
@@ -55,6 +56,7 @@ fn main() {
// StorageLive(_4); // StorageLive(_4);
// _4 = std::option::Option<std::boxed::Box<u32>>::None; // _4 = std::option::Option<std::boxed::Box<u32>>::None;
// AscribeUserType(_4, o, Canonical { variables: [], value: std::option::Option<std::boxed::Box<u32>> }); // AscribeUserType(_4, o, Canonical { variables: [], value: std::option::Option<std::boxed::Box<u32>> });
// FakeRead(ForLet, _4);
// StorageLive(_5); // StorageLive(_5);
// StorageLive(_6); // StorageLive(_6);
// _6 = move _4; // _6 = move _4;

View File

@@ -63,6 +63,7 @@ impl Drop for S {
// //
// bb4: { // bb4: {
// StorageDead(_2); // StorageDead(_2);
// FakeRead(ForLet, _1);
// StorageLive(_4); // StorageLive(_4);
// _4 = move _1; // _4 = move _1;
// _3 = const std::mem::drop(move _4) -> [return: bb5, unwind: bb7]; // _3 = const std::mem::drop(move _4) -> [return: bb5, unwind: bb7];

View File

@@ -29,8 +29,10 @@ fn main() {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = const 3i32; // _1 = const 3i32;
// FakeRead(ForLet, _1);
// StorageLive(_2); // StorageLive(_2);
// _2 = &'10_1rs _1; // _2 = &'10_1rs _1;
// FakeRead(ForLet, _2);
// _0 = (); // _0 = ();
// EndRegion('10_1rs); // EndRegion('10_1rs);
// StorageDead(_2); // StorageDead(_2);

View File

@@ -45,8 +45,10 @@ fn main() {
// bb2: { // bb2: {
// StorageLive(_2); // StorageLive(_2);
// _2 = const true; // _2 = const true;
// FakeRead(ForLet, _2);
// StorageLive(_3); // StorageLive(_3);
// _3 = &'23_1rs _2; // _3 = &'23_1rs _2;
// FakeRead(ForLet, _3);
// StorageLive(_5); // StorageLive(_5);
// _5 = _2; // _5 = _2;
// switchInt(move _5) -> [false: bb5, otherwise: bb4]; // switchInt(move _5) -> [false: bb5, otherwise: bb4];
@@ -67,6 +69,7 @@ fn main() {
// StorageDead(_5); // StorageDead(_5);
// StorageLive(_7); // StorageLive(_7);
// _7 = &'23_3rs _2; // _7 = &'23_3rs _2;
// FakeRead(ForLet, _7);
// _1 = (); // _1 = ();
// EndRegion('23_3rs); // EndRegion('23_3rs);
// StorageDead(_7); // StorageDead(_7);

View File

@@ -49,6 +49,7 @@ fn main() {
// _1 = const true; // _1 = const true;
// StorageLive(_3); // StorageLive(_3);
// _3 = &'26_1rs _1; // _3 = &'26_1rs _1;
// FakeRead(ForLet, _3);
// StorageLive(_5); // StorageLive(_5);
// _5 = _1; // _5 = _1;
// switchInt(move _5) -> [false: bb5, otherwise: bb4]; // switchInt(move _5) -> [false: bb5, otherwise: bb4];
@@ -69,6 +70,7 @@ fn main() {
// StorageDead(_5); // StorageDead(_5);
// StorageLive(_7); // StorageLive(_7);
// _7 = &'26_3rs _1; // _7 = &'26_3rs _1;
// FakeRead(ForLet, _7);
// _2 = (); // _2 = ();
// EndRegion('26_3rs); // EndRegion('26_3rs);
// StorageDead(_7); // StorageDead(_7);

View File

@@ -45,10 +45,13 @@ fn foo(i: i32) {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,); // _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_2); // StorageLive(_2);
// _2 = const 0i32; // _2 = const 0i32;
// FakeRead(ForLet, _2);
// StorageLive(_3); // StorageLive(_3);
// _3 = &'26_2rs _2; // _3 = &'26_2rs _2;
// FakeRead(ForLet, _3);
// StorageLive(_5); // StorageLive(_5);
// _5 = (*_3); // _5 = (*_3);
// _4 = const foo(move _5) -> [return: bb2, unwind: bb3]; // _4 = const foo(move _5) -> [return: bb2, unwind: bb3];
@@ -60,6 +63,7 @@ fn foo(i: i32) {
// StorageDead(_5); // StorageDead(_5);
// StorageLive(_6); // StorageLive(_6);
// _6 = &'26_4rs _2; // _6 = &'26_4rs _2;
// FakeRead(ForLet, _6);
// _0 = (); // _0 = ();
// EndRegion('26_4rs); // EndRegion('26_4rs);
// StorageDead(_6); // StorageDead(_6);

View File

@@ -38,6 +38,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,); // _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_3); // StorageLive(_3);
// StorageLive(_4); // StorageLive(_4);
// _4 = &'14s _1; // _4 = &'14s _1;

View File

@@ -38,6 +38,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,); // _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_3); // StorageLive(_3);
// StorageLive(_4); // StorageLive(_4);
// _4 = &'19s _1; // _4 = &'19s _1;
@@ -73,6 +74,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// bb0: { // bb0: {
// StorageLive(_2); // StorageLive(_2);
// _2 = &'16_0rs (*(_1.0: &'19s D)); // _2 = &'16_0rs (*(_1.0: &'19s D));
// FakeRead(ForLet, _2);
// _0 = ((*_2).0: i32); // _0 = ((*_2).0: i32);
// EndRegion('16_0rs); // EndRegion('16_0rs);
// StorageDead(_2); // StorageDead(_2);

View File

@@ -37,6 +37,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,); // _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_3); // StorageLive(_3);
// _3 = [closure@NodeId(22)] { d: move _1 }; // _3 = [closure@NodeId(22)] { d: move _1 };
// _2 = const foo(move _3) -> [return: bb2, unwind: bb4]; // _2 = const foo(move _3) -> [return: bb2, unwind: bb4];
@@ -74,6 +75,7 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// bb0: { // bb0: {
// StorageLive(_2); // StorageLive(_2);
// _2 = &'16_0rs (_1.0: D); // _2 = &'16_0rs (_1.0: D);
// FakeRead(ForLet, _2);
// _0 = ((*_2).0: i32); // _0 = ((*_2).0: i32);
// EndRegion('16_0rs); // EndRegion('16_0rs);
// StorageDead(_2); // StorageDead(_2);

View File

@@ -40,8 +40,10 @@ fn foo<F>(f: F) where F: FnOnce() -> i32 {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = D::{{constructor}}(const 0i32,); // _1 = D::{{constructor}}(const 0i32,);
// FakeRead(ForLet, _1);
// StorageLive(_2); // StorageLive(_2);
// _2 = &'21_1rs _1; // _2 = &'21_1rs _1;
// FakeRead(ForLet, _2);
// StorageLive(_4); // StorageLive(_4);
// _4 = [closure@NodeId(22)] { r: _2 }; // _4 = [closure@NodeId(22)] { r: _2 };
// _3 = const foo(move _4) -> [return: bb2, unwind: bb3]; // _3 = const foo(move _4) -> [return: bb2, unwind: bb3];

View File

@@ -55,8 +55,10 @@ fn main() {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = const false; // _1 = const false;
// FakeRead(ForLet, _1);
// StorageLive(_2); // StorageLive(_2);
// _2 = const 3i32; // _2 = const 3i32;
// FakeRead(ForLet, _2);
// falseUnwind -> [real: bb2, cleanup: bb1]; // falseUnwind -> [real: bb2, cleanup: bb1];
// } // }
// bb1: { // bb1: {

View File

@@ -83,6 +83,7 @@ fn query() -> bool { true }
// StorageDead(_4); // StorageDead(_4);
// _2 = S<'36_0rs> { r: move _3 }; // _2 = S<'36_0rs> { r: move _3 };
// StorageDead(_3); // StorageDead(_3);
// FakeRead(ForLet, _2);
// StorageLive(_6); // StorageLive(_6);
// _6 = &'17s (_2.0: std::cell::Cell<std::option::Option<&'36_0rs S<'36_0rs>>>); // _6 = &'17s (_2.0: std::cell::Cell<std::option::Option<&'36_0rs S<'36_0rs>>>);
// StorageLive(_7); // StorageLive(_7);

View File

@@ -40,6 +40,7 @@ fn foo<T: Copy>(_t: T, q: &i32) -> i32 {
// _5 = (move _6, move _7); // _5 = (move _6, move _7);
// _8 = move (_5.0: &i32); // _8 = move (_5.0: &i32);
// _9 = move (_5.1: &i32); // _9 = move (_5.1: &i32);
// ...
// _0 = (*_8); // _0 = (*_8);
// ... // ...
// return; // return;

View File

@@ -25,6 +25,7 @@ fn main() {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = const false; // _1 = const false;
// FakeRead(ForLet, _1);
// goto -> bb2; // goto -> bb2;
// } // }
// bb1: { // bb1: {

View File

@@ -87,6 +87,7 @@ fn main() {
// goto -> bb6; // goto -> bb6;
// } // }
// bb14: { // bb14: {
// FakeRead(ForLet, _2);
// StorageDead(_3); // StorageDead(_3);
// StorageLive(_7); // StorageLive(_7);
// _7 = &_2; // _7 = &_2;

View File

@@ -42,6 +42,7 @@ fn main() {
// bb5: { // The loop body (body_block) // bb5: { // The loop body (body_block)
// StorageLive(_5); // StorageLive(_5);
// _5 = const 1i32; // _5 = const 1i32;
// FakeRead(ForLet, _5);
// StorageDead(_5); // StorageDead(_5);
// goto -> bb4; // goto -> bb4;
// } // }

View File

@@ -66,15 +66,15 @@ fn main() {
// goto -> bb13; // goto -> bb13;
// } // }
// bb3: { // binding3(empty) and arm3 // bb3: { // binding3(empty) and arm3
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1 // falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1
// } // }
// bb4: { // bb4: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding2 // falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding2
// } // }
// bb5: { // bb5: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb2, imaginary: bb6]; //pre_binding3 // falseEdges -> [real: bb2, imaginary: bb6]; //pre_binding3
// } // }
// bb6: { // bb6: {
@@ -136,15 +136,15 @@ fn main() {
// goto -> bb13; // goto -> bb13;
// } // }
// bb3: { // bb3: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1 // falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1
// } // }
// bb4: { // bb4: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb2, imaginary: bb5]; //pre_binding2 // falseEdges -> [real: bb2, imaginary: bb5]; //pre_binding2
// } // }
// bb5: { // bb5: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb12, imaginary: bb6]; //pre_binding3 // falseEdges -> [real: bb12, imaginary: bb6]; //pre_binding3
// } // }
// bb6: { // bb6: {
@@ -202,19 +202,19 @@ fn main() {
// resume; // resume;
// } // }
// bb2: { // bb2: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb7, imaginary: bb3]; //pre_binding1 // falseEdges -> [real: bb7, imaginary: bb3]; //pre_binding1
// } // }
// bb3: { // bb3: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb11, imaginary: bb4]; //pre_binding2 // falseEdges -> [real: bb11, imaginary: bb4]; //pre_binding2
// } // }
// bb4: { // bb4: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding3 // falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding3
// } // }
// bb5: { // bb5: {
// ReadForMatch(_4); // FakeRead(ForMatch, _4);
// falseEdges -> [real: bb16, imaginary: bb6]; //pre_binding4 // falseEdges -> [real: bb16, imaginary: bb6]; //pre_binding4
// } // }
// bb6: { // bb6: {

View File

@@ -32,9 +32,9 @@ fn main() {
// END RUST SOURCE // END RUST SOURCE
// START rustc.main.nll.0.mir // START rustc.main.nll.0.mir
// | '_#2r | U0 | {bb2[0..=3], bb3[0..=1]} // | '_#2r | U0 | {bb2[0..=5], bb3[0..=1]}
// | '_#3r | U0 | {bb2[1..=3], bb3[0..=1]} // | '_#3r | U0 | {bb2[1..=5], bb3[0..=1]}
// | '_#4r | U0 | {bb2[3], bb3[0..=1]} // | '_#4r | U0 | {bb2[4..=5], bb3[0..=1]}
// END rustc.main.nll.0.mir // END rustc.main.nll.0.mir
// START rustc.main.nll.0.mir // START rustc.main.nll.0.mir
// let _6: &'_#4r usize; // let _6: &'_#4r usize;

View File

@@ -23,6 +23,7 @@ fn main() {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = const 0i32; // _1 = const 0i32;
// FakeRead(ForLet, _1);
// StorageLive(_3); // StorageLive(_3);
// StorageLive(_4); // StorageLive(_4);
// StorageLive(_5); // StorageLive(_5);
@@ -30,11 +31,13 @@ fn main() {
// _4 = std::option::Option<i32>::Some(move _5,); // _4 = std::option::Option<i32>::Some(move _5,);
// StorageDead(_5); // StorageDead(_5);
// _3 = &_4; // _3 = &_4;
// FakeRead(ForLet, _3);
// _2 = (); // _2 = ();
// StorageDead(_4); // StorageDead(_4);
// StorageDead(_3); // StorageDead(_3);
// StorageLive(_6); // StorageLive(_6);
// _6 = const 1i32; // _6 = const 1i32;
// FakeRead(ForLet, _6);
// _0 = (); // _0 = ();
// StorageDead(_6); // StorageDead(_6);
// StorageDead(_1); // StorageDead(_1);

View File

@@ -67,6 +67,7 @@ fn main() {
// Validate(Suspend(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 })), [(*_2): i32]); // Validate(Suspend(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 })), [(*_2): i32]);
// _3 = &ReErased (*_2); // _3 = &ReErased (*_2);
// Validate(Acquire, [(*_3): i32/ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 }) (imm)]); // Validate(Acquire, [(*_3): i32/ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 }) (imm)]);
// FakeRead(ForLet, _3);
// _0 = (*_3); // _0 = (*_3);
// EndRegion(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 })); // EndRegion(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 }));
// StorageDead(_3); // StorageDead(_3);

View File

@@ -28,6 +28,7 @@ fn main() {
// Validate(Acquire, [_1: std::boxed::Box<[i32]>]); // Validate(Acquire, [_1: std::boxed::Box<[i32]>]);
// StorageDead(_2); // StorageDead(_2);
// StorageDead(_3); // StorageDead(_3);
// FakeRead(ForLet, _1);
// _0 = (); // _0 = ();
// Validate(Release, [_1: std::boxed::Box<[i32]>]); // Validate(Release, [_1: std::boxed::Box<[i32]>]);
// drop(_1) -> [return: bb2, unwind: bb3]; // drop(_1) -> [return: bb2, unwind: bb3];

View File

@@ -47,10 +47,12 @@ fn main() {
// bb0: { // bb0: {
// StorageLive(_1); // StorageLive(_1);
// _1 = Test { x: const 0i32 }; // _1 = Test { x: const 0i32 };
// FakeRead(ForLet, _1);
// StorageLive(_2); // StorageLive(_2);
// Validate(Suspend(ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 })), [_1: Test]); // Validate(Suspend(ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 })), [_1: Test]);
// _2 = &ReErased _1; // _2 = &ReErased _1;
// Validate(Acquire, [(*_2): Test/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]); // Validate(Acquire, [(*_2): Test/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);
// FakeRead(ForLet, _2);
// StorageLive(_4); // StorageLive(_4);
// StorageLive(_5); // StorageLive(_5);
// Validate(Suspend(ReScope(Node(ItemLocalId(18)))), [((*_2).0: i32): i32/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]); // Validate(Suspend(ReScope(Node(ItemLocalId(18)))), [((*_2).0: i32): i32/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);