Skip to content

Commit 11dcbb2

Browse files
committed
Update tests
1 parent e6eea54 commit 11dcbb2

7 files changed

Lines changed: 46 additions & 17 deletions

‎tests/unit/out/refcount/union_addrof_external.rs‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl anon_0 {
5151
pub fn h(&self) -> Ptr<record> {
5252
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
5353
}
54-
pub fn raw_(&self) -> Ptr<Box<[u8]>> {
54+
pub fn raw_(&self) -> Ptr<u8> {
5555
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
5656
}
5757
}
@@ -187,12 +187,21 @@ fn main_0() -> i32 {
187187
!= 0)
188188
);
189189
assert!(
190-
((((((*(*c.borrow()).view.borrow()).raw_().read())[(0) as usize] as i32) == 2) as i32)
190+
(((((((*(*c.borrow()).view.borrow())
191+
.raw_()
192+
.reinterpret_cast::<u8>() as Ptr::<u8>)
193+
.offset((0) as isize)
194+
.read()) as i32)
195+
== 2) as i32)
191196
!= 0)
192197
);
193198
assert!(
194-
(((((((*(*c.borrow()).view.borrow()).raw_().read())[(3) as usize] as u8) as i32) == 80)
195-
as i32)
199+
((((((((*(*c.borrow()).view.borrow())
200+
.raw_()
201+
.reinterpret_cast::<u8>() as Ptr::<u8>)
202+
.offset((3) as isize)
203+
.read()) as u8) as i32)
204+
== 80) as i32)
196205
!= 0)
197206
);
198207
return 0;

‎tests/unit/out/refcount/union_cross_arm_cast.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl anon_0 {
8888
pub fn b(&self) -> Ptr<shape_b> {
8989
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
9090
}
91-
pub fn raw_(&self) -> Ptr<Box<[u8]>> {
91+
pub fn raw_(&self) -> Ptr<u8> {
9292
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
9393
}
9494
}

‎tests/unit/out/refcount/union_field_alignment.rs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct anon_0 {
1010
__bytes: Value<Box<[u8]>>,
1111
}
1212
impl anon_0 {
13-
pub fn bytes(&self) -> Ptr<Box<[u8]>> {
13+
pub fn bytes(&self) -> Ptr<u8> {
1414
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
1515
}
1616
pub fn aligner(&self) -> Ptr<AnyPtr> {
@@ -74,7 +74,10 @@ fn main_0() -> i32 {
7474
.offset((0) as isize)
7575
.write(171_u8);
7676
assert!(
77-
((((((*(*n.borrow()).x.borrow()).bytes().read())[(0) as usize] as i32) == 171) as i32)
77+
(((((((*(*n.borrow()).x.borrow()).bytes().reinterpret_cast::<u8>() as Ptr::<u8>)
78+
.offset((0) as isize)
79+
.read()) as i32)
80+
== 171) as i32)
7881
!= 0)
7982
);
8083
return 0;

‎tests/unit/out/refcount/union_memset_memcpy.rs‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl anon_0 {
8484
pub fn b(&self) -> Ptr<shape_b> {
8585
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
8686
}
87-
pub fn raw_(&self) -> Ptr<Box<[u8]>> {
87+
pub fn raw_(&self) -> Ptr<u8> {
8888
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
8989
}
9090
}
@@ -158,11 +158,21 @@ fn main_0() -> i32 {
158158
!= 0)
159159
);
160160
assert!(
161-
((((((*(*c.borrow()).view.borrow()).raw_().read())[(0) as usize] as i32) == 0) as i32)
161+
(((((((*(*c.borrow()).view.borrow())
162+
.raw_()
163+
.reinterpret_cast::<u8>() as Ptr::<u8>)
164+
.offset((0) as isize)
165+
.read()) as i32)
166+
== 0) as i32)
162167
!= 0)
163168
);
164169
assert!(
165-
((((((*(*c.borrow()).view.borrow()).raw_().read())[(255) as usize] as i32) == 0) as i32)
170+
(((((((*(*c.borrow()).view.borrow())
171+
.raw_()
172+
.reinterpret_cast::<u8>() as Ptr::<u8>)
173+
.offset((255) as isize)
174+
.read()) as i32)
175+
== 0) as i32)
166176
!= 0)
167177
);
168178
let src: Value<Box<[u8]>> = Rc::new(RefCell::new(Box::new([

‎tests/unit/out/refcount/union_nested.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl anon_0 {
4343
pub fn h(&self) -> Ptr<record> {
4444
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
4545
}
46-
pub fn raw_(&self) -> Ptr<Box<[u8]>> {
46+
pub fn raw_(&self) -> Ptr<u8> {
4747
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
4848
}
4949
}

‎tests/unit/out/refcount/union_struct_dual_use.rs‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl anon_1 {
4040
pub fn inner(&self) -> Ptr<Inner> {
4141
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
4242
}
43-
pub fn raw_(&self) -> Ptr<Box<[u8]>> {
43+
pub fn raw_(&self) -> Ptr<u8> {
4444
(self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast()
4545
}
4646
}
@@ -114,13 +114,21 @@ fn main_0() -> i32 {
114114
!= 0)
115115
);
116116
assert!(
117-
(((((((*(*outer.borrow()).u.borrow()).raw_().read())[(0) as usize] as u8) as i32) == 3)
118-
as i32)
117+
((((((((*(*outer.borrow()).u.borrow())
118+
.raw_()
119+
.reinterpret_cast::<u8>() as Ptr::<u8>)
120+
.offset((0) as isize)
121+
.read()) as u8) as i32)
122+
== 3) as i32)
119123
!= 0)
120124
);
121125
assert!(
122-
(((((((*(*outer.borrow()).u.borrow()).raw_().read())[(4) as usize] as u8) as i32) == 4)
123-
as i32)
126+
((((((((*(*outer.borrow()).u.borrow())
127+
.raw_()
128+
.reinterpret_cast::<u8>() as Ptr::<u8>)
129+
.offset((4) as isize)
130+
.read()) as u8) as i32)
131+
== 4) as i32)
124132
!= 0)
125133
);
126134
return 0;

‎tests/unit/union_field_alignment.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// panic: refcount
21
#include <assert.h>
32
#include <stddef.h>
43
#include <stdint.h>

0 commit comments

Comments
 (0)