Skip to content

Commit 611c3cb

Browse files
committed
Bless/fix tests
1 parent 9e1b2d9 commit 611c3cb

File tree

28 files changed

+1113
-1150
lines changed

28 files changed

+1113
-1150
lines changed

tests/assembly/is_aligned.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// only-x86_64
33
// ignore-sgx
44
// revisions: opt-speed opt-size
5-
// [opt-speed] compile-flags: -Copt-level=1
6-
// [opt-size] compile-flags: -Copt-level=s
5+
// [opt-speed] compile-flags: -Copt-level=2 -Cdebug-assertions=no
6+
// [opt-size] compile-flags: -Copt-level=s -Cdebug-assertions=no
77
#![crate_type="rlib"]
88

99
#![feature(core_intrinsics)]

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff

+27-33
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,11 @@
2424
debug ptr => _6;
2525
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
2626
debug ptr => _6;
27-
let mut _8: *const [bool; 0];
28-
let mut _9: *mut [bool; 0];
27+
let mut _8: bool;
28+
let _9: ();
29+
let mut _10: *mut ();
30+
let mut _11: *const [bool; 0];
2931
scope 12 {
30-
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
31-
debug ptr => _9;
32-
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
33-
debug self => _9;
34-
let mut _10: *mut u8;
35-
scope 15 {
36-
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
37-
debug ptr => _10;
38-
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
39-
debug self => _10;
40-
scope 18 {
41-
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
42-
debug self => _10;
43-
}
44-
}
45-
}
46-
}
47-
}
48-
}
49-
}
5032
}
5133
}
5234
}
@@ -66,37 +48,49 @@
6648
StorageLive(_1);
6749
StorageLive(_2);
6850
StorageLive(_3);
51+
StorageLive(_9);
6952
StorageLive(_4);
7053
StorageLive(_5);
7154
StorageLive(_6);
7255
StorageLive(_7);
7356
_7 = const 1_usize;
7457
_6 = const {0x1 as *mut [bool; 0]};
7558
StorageDead(_7);
76-
StorageLive(_8);
77-
StorageLive(_9);
7859
StorageLive(_10);
79-
_8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
80-
_5 = NonNull::<[bool; 0]> { pointer: _8 };
81-
StorageDead(_10);
82-
StorageDead(_9);
60+
StorageLive(_11);
61+
StorageLive(_8);
62+
_8 = cfg!(debug_assertions);
63+
switchInt(move _8) -> [0: bb3, otherwise: bb2];
64+
}
65+
66+
bb1: {
67+
StorageDead(_1);
68+
return;
69+
}
70+
71+
bb2: {
72+
_10 = const {0x1 as *mut [bool; 0]} as *mut () (PtrToPtr);
73+
_9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable];
74+
}
75+
76+
bb3: {
8377
StorageDead(_8);
78+
_11 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
79+
_5 = NonNull::<[bool; 0]> { pointer: _11 };
80+
StorageDead(_11);
81+
StorageDead(_10);
8482
StorageDead(_6);
8583
_4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> };
8684
StorageDead(_5);
8785
_3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize));
8886
StorageDead(_4);
8987
_2 = Box::<[bool]>(_3, const std::alloc::Global);
88+
StorageDead(_9);
9089
StorageDead(_3);
9190
_1 = A { foo: move _2 };
9291
StorageDead(_2);
9392
_0 = const ();
9493
drop(_1) -> [return: bb1, unwind unreachable];
9594
}
96-
97-
bb1: {
98-
StorageDead(_1);
99-
return;
100-
}
10195
}
10296

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff

+31-37
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,11 @@
2424
debug ptr => _6;
2525
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
2626
debug ptr => _6;
27-
let mut _8: *const [bool; 0];
28-
let mut _9: *mut [bool; 0];
27+
let mut _8: bool;
28+
let _9: ();
29+
let mut _10: *mut ();
30+
let mut _11: *const [bool; 0];
2931
scope 12 {
30-
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
31-
debug ptr => _9;
32-
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
33-
debug self => _9;
34-
let mut _10: *mut u8;
35-
scope 15 {
36-
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
37-
debug ptr => _10;
38-
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
39-
debug self => _10;
40-
scope 18 {
41-
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
42-
debug self => _10;
43-
}
44-
}
45-
}
46-
}
47-
}
48-
}
49-
}
5032
}
5133
}
5234
}
@@ -66,41 +48,53 @@
6648
StorageLive(_1);
6749
StorageLive(_2);
6850
StorageLive(_3);
51+
StorageLive(_9);
6952
StorageLive(_4);
7053
StorageLive(_5);
7154
StorageLive(_6);
7255
StorageLive(_7);
7356
_7 = const 1_usize;
7457
_6 = const {0x1 as *mut [bool; 0]};
7558
StorageDead(_7);
76-
StorageLive(_8);
77-
StorageLive(_9);
7859
StorageLive(_10);
79-
_8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
80-
_5 = NonNull::<[bool; 0]> { pointer: _8 };
81-
StorageDead(_10);
82-
StorageDead(_9);
60+
StorageLive(_11);
61+
StorageLive(_8);
62+
_8 = cfg!(debug_assertions);
63+
switchInt(move _8) -> [0: bb4, otherwise: bb3];
64+
}
65+
66+
bb1: {
67+
StorageDead(_1);
68+
return;
69+
}
70+
71+
bb2 (cleanup): {
72+
resume;
73+
}
74+
75+
bb3: {
76+
_10 = const {0x1 as *mut [bool; 0]} as *mut () (PtrToPtr);
77+
_9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb4, unwind unreachable];
78+
}
79+
80+
bb4: {
8381
StorageDead(_8);
82+
_11 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
83+
_5 = NonNull::<[bool; 0]> { pointer: _11 };
84+
StorageDead(_11);
85+
StorageDead(_10);
8486
StorageDead(_6);
8587
_4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> };
8688
StorageDead(_5);
8789
_3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize));
8890
StorageDead(_4);
8991
_2 = Box::<[bool]>(_3, const std::alloc::Global);
92+
StorageDead(_9);
9093
StorageDead(_3);
9194
_1 = A { foo: move _2 };
9295
StorageDead(_2);
9396
_0 = const ();
9497
drop(_1) -> [return: bb1, unwind: bb2];
9598
}
96-
97-
bb1: {
98-
StorageDead(_1);
99-
return;
100-
}
101-
102-
bb2 (cleanup): {
103-
resume;
104-
}
10599
}
106100

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff

+27-33
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,11 @@
2424
debug ptr => _6;
2525
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
2626
debug ptr => _6;
27-
let mut _8: *const [bool; 0];
28-
let mut _9: *mut [bool; 0];
27+
let mut _8: bool;
28+
let _9: ();
29+
let mut _10: *mut ();
30+
let mut _11: *const [bool; 0];
2931
scope 12 {
30-
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
31-
debug ptr => _9;
32-
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
33-
debug self => _9;
34-
let mut _10: *mut u8;
35-
scope 15 {
36-
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
37-
debug ptr => _10;
38-
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
39-
debug self => _10;
40-
scope 18 {
41-
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
42-
debug self => _10;
43-
}
44-
}
45-
}
46-
}
47-
}
48-
}
49-
}
5032
}
5133
}
5234
}
@@ -66,37 +48,49 @@
6648
StorageLive(_1);
6749
StorageLive(_2);
6850
StorageLive(_3);
51+
StorageLive(_9);
6952
StorageLive(_4);
7053
StorageLive(_5);
7154
StorageLive(_6);
7255
StorageLive(_7);
7356
_7 = const 1_usize;
7457
_6 = const {0x1 as *mut [bool; 0]};
7558
StorageDead(_7);
76-
StorageLive(_8);
77-
StorageLive(_9);
7859
StorageLive(_10);
79-
_8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
80-
_5 = NonNull::<[bool; 0]> { pointer: _8 };
81-
StorageDead(_10);
82-
StorageDead(_9);
60+
StorageLive(_11);
61+
StorageLive(_8);
62+
_8 = cfg!(debug_assertions);
63+
switchInt(move _8) -> [0: bb3, otherwise: bb2];
64+
}
65+
66+
bb1: {
67+
StorageDead(_1);
68+
return;
69+
}
70+
71+
bb2: {
72+
_10 = const {0x1 as *mut [bool; 0]} as *mut () (PtrToPtr);
73+
_9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable];
74+
}
75+
76+
bb3: {
8377
StorageDead(_8);
78+
_11 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
79+
_5 = NonNull::<[bool; 0]> { pointer: _11 };
80+
StorageDead(_11);
81+
StorageDead(_10);
8482
StorageDead(_6);
8583
_4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> };
8684
StorageDead(_5);
8785
_3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize));
8886
StorageDead(_4);
8987
_2 = Box::<[bool]>(_3, const std::alloc::Global);
88+
StorageDead(_9);
9089
StorageDead(_3);
9190
_1 = A { foo: move _2 };
9291
StorageDead(_2);
9392
_0 = const ();
9493
drop(_1) -> [return: bb1, unwind unreachable];
9594
}
96-
97-
bb1: {
98-
StorageDead(_1);
99-
return;
100-
}
10195
}
10296

0 commit comments

Comments
 (0)