Skip to content

Commit 96c3978

Browse files
committed
Repurpose defunct test.
1 parent 5407eb8 commit 96c3978

File tree

4 files changed

+48
-64
lines changed

4 files changed

+48
-64
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
- // MIR for `main` before GVN
2+
+ // MIR for `main` after GVN
3+
4+
fn main() -> () {
5+
let mut _0: ();
6+
let _1: main::Un;
7+
let mut _2: u32;
8+
let _3: ();
9+
let mut _4: u32;
10+
scope 1 {
11+
debug un => _1;
12+
scope 3 (inlined std::mem::drop::<u32>) {
13+
}
14+
}
15+
scope 2 (inlined val) {
16+
}
17+
18+
bb0: {
19+
StorageLive(_1);
20+
- StorageLive(_2);
21+
+ nop;
22+
_2 = const 1_u32;
23+
- _1 = Un { us: move _2 };
24+
- StorageDead(_2);
25+
+ _1 = const Un {{ us: 1_u32 }};
26+
+ nop;
27+
StorageLive(_3);
28+
StorageLive(_4);
29+
- _4 = copy (_1.0: u32);
30+
+ _4 = const 1_u32;
31+
StorageDead(_4);
32+
StorageDead(_3);
33+
_0 = const ();
34+
StorageDead(_1);
35+
return;
36+
}
37+
+ }
38+
+
39+
+ ALLOC0 (size: 4, align: 4) {
40+
+ 01 00 00 00 │ ....
41+
}
42+

tests/mir-opt/dest-prop/union.rs renamed to tests/mir-opt/const_prop/union.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
21
//! Tests that we can propagate into places that are projections into unions
3-
//@ compile-flags: -Zunsound-mir-opts -C debuginfo=full
2+
//@ test-mir-pass: GVN
3+
//@ compile-flags: -Zinline-mir
4+
45
fn val() -> u32 {
56
1
67
}
78

8-
// EMIT_MIR union.main.DestinationPropagation.diff
9+
// EMIT_MIR union.main.GVN.diff
910
fn main() {
1011
// CHECK-LABEL: fn main(
11-
// CHECK: debug un => const Un
12-
// CHECK: debug _x => const 1_u32;
12+
// CHECK: debug un => [[un:_.*]];
1313
// CHECK: bb0: {
14-
// CHECK-NEXT: return;
14+
// CHECK: [[un]] = const Un {{{{ us: 1_u32 }}}};
1515
union Un {
1616
us: u32,
1717
}

tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)