Skip to content

Commit 547d7d8

Browse files
committed
update mir-opt tests & fix codegen-llvm test
1 parent ca3194a commit 547d7d8

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

tests/codegen-llvm/naked-fn/generics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ fn test(x: u64) {
2020
}
2121

2222
// CHECK: .balign 4
23-
// CHECK: add rax, 2
23+
// CHECK: add rax, 1
2424
// CHECK: add rax, 42
2525

2626
// CHECK: .balign 4
27-
// CHECK: add rax, 1
27+
// CHECK: add rax, 2
2828
// CHECK: add rax, 42
2929

3030
#[unsafe(naked)]

tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-unwind.diff

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@
3434

3535
bb0: {
3636
StorageLive(_1);
37-
- _1 = OffsetOf(Alpha, FieldPath([(0, 0)]));
37+
- _1 = FieldOffset(field_of!(Alpha, x));
3838
+ _1 = const 4_usize;
3939
StorageLive(_2);
40-
- _2 = OffsetOf(Alpha, FieldPath([(0, 1)]));
40+
- _2 = FieldOffset(field_of!(Alpha, y));
4141
+ _2 = const 0_usize;
4242
StorageLive(_3);
43-
- _3 = OffsetOf(Alpha, FieldPath([(0, 2), (0, 0)]));
43+
- _3 = FieldOffset(field_of!(Alpha, z.0));
4444
+ _3 = const 2_usize;
4545
StorageLive(_4);
46-
- _4 = OffsetOf(Alpha, FieldPath([(0, 2), (0, 1)]));
46+
- _4 = FieldOffset(field_of!(Alpha, z.1));
4747
+ _4 = const 3_usize;
4848
StorageLive(_5);
49-
- _5 = OffsetOf(Epsilon, FieldPath([(0, 0)]));
49+
- _5 = FieldOffset(field_of!(Epsilon, 0));
5050
+ _5 = const 1_usize;
5151
StorageLive(_6);
52-
- _6 = OffsetOf(Epsilon, FieldPath([(0, 1)]));
52+
- _6 = FieldOffset(field_of!(Epsilon, 1));
5353
+ _6 = const 2_usize;
5454
StorageLive(_7);
55-
- _7 = OffsetOf(Epsilon, FieldPath([(2, 0)]));
55+
- _7 = FieldOffset(field_of!(Epsilon, c));
5656
+ _7 = const 4_usize;
5757
_0 = const ();
5858
StorageDead(_7);

tests/mir-opt/const_prop/offset_of.generic.GVN.panic-unwind.diff

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@
3434

3535
bb0: {
3636
StorageLive(_1);
37-
_1 = OffsetOf(Gamma<T>, FieldPath([(0, 0)]));
37+
_1 = FieldOffset(field_of!(Gamma<T>, x));
3838
StorageLive(_2);
39-
_2 = OffsetOf(Gamma<T>, FieldPath([(0, 1)]));
39+
_2 = FieldOffset(field_of!(Gamma<T>, y));
4040
StorageLive(_3);
41-
- _3 = OffsetOf(Delta<T>, FieldPath([(0, 1)]));
41+
- _3 = FieldOffset(field_of!(Delta<T>, x));
4242
+ _3 = const 0_usize;
4343
StorageLive(_4);
44-
- _4 = OffsetOf(Delta<T>, FieldPath([(0, 2)]));
44+
- _4 = FieldOffset(field_of!(Delta<T>, y));
4545
+ _4 = const 2_usize;
4646
StorageLive(_5);
47-
_5 = OffsetOf(Zeta<T>, FieldPath([(0, 0)]));
47+
_5 = FieldOffset(field_of!(Zeta<T>, 0));
4848
StorageLive(_6);
49-
_6 = OffsetOf(Zeta<T>, FieldPath([(0, 1)]));
49+
_6 = FieldOffset(field_of!(Zeta<T>, 1));
5050
StorageLive(_7);
51-
_7 = OffsetOf(Zeta<T>, FieldPath([(1, 0)]));
51+
_7 = FieldOffset(field_of!(Zeta<T>, 0));
5252
_0 = const ();
5353
StorageDead(_7);
5454
StorageDead(_6);

tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-unwind.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222

2323
bb0: {
2424
StorageLive(_1);
25-
- _1 = OffsetOf(Alpha, FieldPath([(0, 0)]));
25+
- _1 = FieldOffset(field_of!(Alpha, x));
2626
+ _1 = const 4_usize;
2727
StorageLive(_2);
28-
- _2 = OffsetOf(Alpha, FieldPath([(0, 1)]));
28+
- _2 = FieldOffset(field_of!(Alpha, y));
2929
+ _2 = const 0_usize;
3030
StorageLive(_3);
31-
- _3 = OffsetOf(Alpha, FieldPath([(0, 2), (0, 0)]));
31+
- _3 = FieldOffset(field_of!(Alpha, z.0));
3232
+ _3 = const 2_usize;
3333
StorageLive(_4);
34-
- _4 = OffsetOf(Alpha, FieldPath([(0, 2), (0, 1)]));
34+
- _4 = FieldOffset(field_of!(Alpha, z.1));
3535
+ _4 = const 3_usize;
3636
_0 = const ();
3737
StorageDead(_4);

tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-unwind.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
bb0: {
2424
StorageLive(_1);
25-
_1 = OffsetOf(Gamma<T>, FieldPath([(0, 0)]));
25+
_1 = FieldOffset(field_of!(Gamma<T>, x));
2626
StorageLive(_2);
27-
_2 = OffsetOf(Gamma<T>, FieldPath([(0, 1)]));
27+
_2 = FieldOffset(field_of!(Gamma<T>, y));
2828
StorageLive(_3);
29-
- _3 = OffsetOf(Delta<T>, FieldPath([(0, 1)]));
29+
- _3 = FieldOffset(field_of!(Delta<T>, x));
3030
+ _3 = const 0_usize;
3131
StorageLive(_4);
32-
- _4 = OffsetOf(Delta<T>, FieldPath([(0, 2)]));
32+
- _4 = FieldOffset(field_of!(Delta<T>, y));
3333
+ _4 = const 2_usize;
3434
_0 = const ();
3535
StorageDead(_4);

tests/mir-opt/dataflow-const-prop/offset_of.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ fn generic<T>() {
5656
// CHECK: debug dx => [[dx:_.*]];
5757
// CHECK: debug dy => [[dy:_.*]];
5858

59-
// CHECK: [[gx]] = OffsetOf(Gamma<T>, FieldPath([(0, 0)]));
59+
// CHECK: [[gx]] = FieldOffset(field_of!(Gamma<T>, x));
6060
let gx = offset_of!(Gamma<T>, x);
6161

62-
// CHECK: [[gy]] = OffsetOf(Gamma<T>, FieldPath([(0, 1)]));
62+
// CHECK: [[gy]] = FieldOffset(field_of!(Gamma<T>, y));
6363
let gy = offset_of!(Gamma<T>, y);
6464

6565
// CHECK: [[dx]] = const 0_usize

0 commit comments

Comments
 (0)