Skip to content

Commit d1c67a0

Browse files
committed
FileCheck basic_assignment.rs.
1 parent 1fd79d1 commit d1c67a0

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// MIR for `main` after SimplifyCfg-initial
22

33
| User Type Annotations
4-
| 0: user_ty: Canonical { value: Ty(std::option::Option<std::boxed::Box<u32>>), max_universe: U0, variables: [] }, span: $DIR/basic_assignment.rs:21:17: 21:33, inferred_ty: std::option::Option<std::boxed::Box<u32>>
5-
| 1: user_ty: Canonical { value: Ty(std::option::Option<std::boxed::Box<u32>>), max_universe: U0, variables: [] }, span: $DIR/basic_assignment.rs:21:17: 21:33, inferred_ty: std::option::Option<std::boxed::Box<u32>>
4+
| 0: user_ty: Canonical { value: Ty(std::option::Option<std::boxed::Box<u32>>), max_universe: U0, variables: [] }, span: $DIR/basic_assignment.rs:38:17: 38:33, inferred_ty: std::option::Option<std::boxed::Box<u32>>
5+
| 1: user_ty: Canonical { value: Ty(std::option::Option<std::boxed::Box<u32>>), max_universe: U0, variables: [] }, span: $DIR/basic_assignment.rs:38:17: 38:33, inferred_ty: std::option::Option<std::boxed::Box<u32>>
66
|
77
fn main() -> () {
88
let mut _0: ();

tests/mir-opt/basic_assignment.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// skip-filecheck
1+
// unit-test: ElaborateDrops
22
// needs-unwind
33
// this tests move up progration, which is not yet implemented
44

@@ -11,6 +11,23 @@
1111
// destruction.
1212

1313
fn main() {
14+
// CHECK-LABEL: fn main(
15+
// CHECK: debug nodrop_x => [[nodrop_x:_.*]];
16+
// CHECK: debug nodrop_y => [[nodrop_y:_.*]];
17+
// CHECK: debug drop_x => [[drop_x:_.*]];
18+
// CHECK: debug drop_y => [[drop_y:_.*]];
19+
// CHECK-NOT: drop([[nodrop_x]])
20+
// CHECK-NOT: drop([[nodrop_y]])
21+
// CHECK-NOT: drop([[drop_x]])
22+
// CHECK: [[drop_tmp:_.*]] = move [[drop_x]];
23+
// CHECK-NOT: drop([[drop_x]])
24+
// CHECK-NOT: drop([[drop_tmp]])
25+
// CHECK: [[drop_y]] = move [[drop_tmp]];
26+
// CHECK-NOT: drop([[drop_x]])
27+
// CHECK-NOT: drop([[drop_tmp]])
28+
// CHECK: drop([[drop_y]])
29+
// CHECK-NOT: drop([[drop_x]])
30+
// CHECK-NOT: drop([[drop_tmp]])
1431
let nodrop_x = false;
1532
let nodrop_y;
1633

0 commit comments

Comments
 (0)