Skip to content

Commit 54ff25e

Browse files
committed
bless mir-opt tests
1 parent 22d6204 commit 54ff25e

9 files changed

+147
-4
lines changed

src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir

+45
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,48 @@ fn main() -> () {
1919
return; // scope 0 at $DIR/const_allocation.rs:9:2: 9:2
2020
}
2121
}
22+
23+
alloc1 (static: FOO, size: 16, align: 8) {
24+
╾───────alloc18───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
25+
}
26+
27+
alloc18 (size: 72, align: 8) {
28+
0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc5────────╼ │ ....░░░░╾──────╼
29+
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
30+
0x20 │ ╾───────alloc9────────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
31+
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc14───────╼ │ ....*...╾──────╼
32+
0x40 │ 03 00 00 00 00 00 00 00 │ ........
33+
}
34+
35+
alloc5 (size: 0, align: 8) {}
36+
37+
alloc9 (size: 32, align: 8) {
38+
0x00 │ ╾───────alloc8────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
39+
0x10 │ ╾───────alloc10───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
40+
}
41+
42+
alloc8 (size: 3, align: 1) {
43+
66 6f 6f │ foo
44+
}
45+
46+
alloc10 (size: 3, align: 1) {
47+
62 61 72 │ bar
48+
}
49+
50+
alloc14 (size: 48, align: 8) {
51+
0x00 │ ╾───────alloc13───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
52+
0x10 │ ╾───────alloc15───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
53+
0x20 │ ╾───────alloc16───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
54+
}
55+
56+
alloc13 (size: 3, align: 1) {
57+
6d 65 68 │ meh
58+
}
59+
60+
alloc15 (size: 3, align: 1) {
61+
6d 6f 70 │ mop
62+
}
63+
64+
alloc16 (size: 4, align: 1) {
65+
6d c3 b6 70 │ m..p
66+
}

src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir

+43
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,46 @@ fn main() -> () {
1919
return; // scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
2020
}
2121
}
22+
23+
alloc1 (static: FOO, size: 16, align: 8) {
24+
╾───────alloc28───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
25+
}
26+
27+
alloc28 (size: 72, align: 8) {
28+
0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc13───────╼ │ ....░░░░╾──────╼
29+
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
30+
0x20 │ ╾───────alloc18───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
31+
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc26───────╼ │ ....*...╾──────╼
32+
0x40 │ 03 00 00 00 00 00 00 00 │ ........
33+
}
34+
35+
alloc13 (size: 0, align: 8) {}
36+
37+
alloc18 (size: 16, align: 8) {
38+
╾───────alloc16───────╼ ╾───────alloc17───────╼ │ ╾──────╼╾──────╼
39+
}
40+
41+
alloc16 (size: 1, align: 1) {
42+
05 │ .
43+
}
44+
45+
alloc17 (size: 1, align: 1) {
46+
06 │ .
47+
}
48+
49+
alloc26 (size: 24, align: 8) {
50+
0x00 │ ╾─────alloc22+0x3─────╼ ╾───────alloc23───────╼ │ ╾──────╼╾──────╼
51+
0x10 │ ╾─────alloc25+0x2─────╼ │ ╾──────╼
52+
}
53+
54+
alloc22 (size: 4, align: 1) {
55+
2a 45 15 6f │ *E.o
56+
}
57+
58+
alloc23 (size: 1, align: 1) {
59+
2a │ *
60+
}
61+
62+
alloc25 (size: 4, align: 1) {
63+
2a 45 15 6f │ *E.o
64+
}

src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir

+35
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,38 @@ fn main() -> () {
1919
return; // scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
2020
}
2121
}
22+
23+
alloc1 (static: FOO, size: 8, align: 8) {
24+
╾───────alloc11───────╼ │ ╾──────╼
25+
}
26+
27+
alloc11 (size: 180, align: 1) {
28+
0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................
29+
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾──alloc6── │ ............╾───
30+
0x20 │ ──────────╼ 01 ef cd ab 00 00 00 00 00 00 00 00 │ ───╼............
31+
0x30 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
32+
0x40 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
33+
0x50 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
34+
0x60 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
35+
0x70 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
36+
0x80 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ╾──── │ ..............╾─
37+
0x90 │ ─────alloc8─────╼ 00 00 ╾─────alloc9+0x63─────╼ │ ─────╼..╾──────╼
38+
0xa0 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
39+
0xb0 │ 00 00 00 00 │ ....
40+
}
41+
42+
alloc6 (size: 4, align: 4) {
43+
2a 00 00 00 │ *...
44+
}
45+
46+
alloc8 (fn: main)
47+
48+
alloc9 (size: 100, align: 1) {
49+
0x00 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
50+
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
51+
0x20 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
52+
0x30 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
53+
0x40 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
54+
0x50 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
55+
0x60 │ 00 00 00 00 │ ....
56+
}

src/test/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ promoted[0] in BAR: &[&i32; 1] = {
1717
return; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
1818
}
1919
}
20+
21+
alloc1 (static: Y, size: 4, align: 4) {
22+
2a 00 00 00 │ *...
23+
}

src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff

+4
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@
4949
bb2 (cleanup): {
5050
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
5151
}
52+
- }
53+
-
54+
- alloc1 (static: Y, size: 4, align: 4) {
55+
- 2a 00 00 00 │ *...
5256
}
5357

src/test/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ promoted[0] in FOO: &[&i32; 1] = {
77
let mut _3: *const i32; // in scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
88

99
bb0: {
10-
_3 = const {alloc2: *const i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
10+
_3 = const {alloc3: *const i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
1111
// mir::Constant
1212
// + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
13-
// + literal: Const { ty: *const i32, val: Value(Scalar(alloc2)) }
13+
// + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
1414
_2 = &(*_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
1515
_1 = [move _2]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
1616
_0 = &_1; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
1717
return; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
1818
}
1919
}
20+
21+
alloc3 (extern static: X)

src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
- StorageLive(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
1919
- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
2020
- StorageLive(_5); // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
21-
- _5 = const {alloc2: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
21+
- _5 = const {alloc3: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
2222
+ _6 = const FOO::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
2323
+ // ty::Const
2424
+ // + ty: &[&i32; 1]
2525
+ // + val: Unevaluated(FOO, [], Some(promoted[0]))
2626
// mir::Constant
2727
- // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
28-
- // + literal: Const { ty: *const i32, val: Value(Scalar(alloc2)) }
28+
- // + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
2929
- _4 = &(*_5); // scope 1 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
3030
- _3 = [move _4]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
3131
- _2 = &_3; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
@@ -52,4 +52,6 @@
5252
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
5353
}
5454
}
55+
-
56+
- alloc3 (extern static: X)
5557

src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff

+4
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@
4242
}
4343
}
4444

45+
alloc1 (static: STATIC, size: 4, align: 4) {
46+
2a 00 00 00 │ *...
47+
}
48+

src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff

+4
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@
4242
}
4343
}
4444

45+
alloc1 (static: FOO, size: 1, align: 1) {
46+
02 │ .
47+
}
48+

0 commit comments

Comments
 (0)