Skip to content

Commit 3af81b8

Browse files
committed
Update tests
1 parent 71f05f4 commit 3af81b8

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

tests/unit/out/refcount/immutable_unsigned_arithmetic.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ pub fn main() {
1212
fn main_0() -> i32 {
1313
let a: Value<u32> = Rc::new(RefCell::new(0_u32));
1414
let p: Value<Ptr<u32>> = Rc::new(RefCell::new((a.as_pointer())));
15-
let rhs_0 = ((*p.borrow()).read()).wrapping_add(((*p.borrow()).read()));
16-
(*p.borrow()).write(rhs_0);
15+
{
16+
let rhs_0 = ((*p.borrow()).read()).wrapping_add(((*p.borrow()).read()));
17+
(*p.borrow()).write(rhs_0)
18+
};
1719
return (((*p.borrow()).read()) as i32);
1820
}

tests/unit/out/refcount/size_t_ssize_t.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,19 @@ fn main_0() -> i32 {
4646
== (((20 + 10) + 5) as usize).wrapping_add((::std::mem::size_of::<i64>() as usize)))
4747
);
4848
let acc: Value<usize> = Rc::new(RefCell::new(100_usize));
49-
let rhs_0 =
50-
(((*acc.borrow()) as u64).wrapping_add((::std::mem::size_of::<f64>() as u64))) as usize;
51-
(*acc.borrow_mut()) = rhs_0;
52-
let rhs_0 = (*acc.borrow()).wrapping_mul(2_usize);
53-
(*acc.borrow_mut()) = rhs_0;
54-
let rhs_0 = (((*acc.borrow()) as u64).wrapping_sub((*ul.borrow()))) as usize;
55-
(*acc.borrow_mut()) = rhs_0;
49+
{
50+
let rhs_0 =
51+
(((*acc.borrow()) as u64).wrapping_add((::std::mem::size_of::<f64>() as u64))) as usize;
52+
(*acc.borrow_mut()) = rhs_0
53+
};
54+
{
55+
let rhs_0 = (*acc.borrow()).wrapping_mul(2_usize);
56+
(*acc.borrow_mut()) = rhs_0
57+
};
58+
{
59+
let rhs_0 = (((*acc.borrow()) as u64).wrapping_sub((*ul.borrow()))) as usize;
60+
(*acc.borrow_mut()) = rhs_0
61+
};
5662
assert!(
5763
((*acc.borrow())
5864
== ((((100_usize).wrapping_add((::std::mem::size_of::<f64>() as usize))) as usize)
@@ -136,9 +142,11 @@ fn main_0() -> i32 {
136142
let total: Value<usize> = Rc::new(RefCell::new(0_usize));
137143
let i: Value<usize> = Rc::new(RefCell::new(0_usize));
138144
'loop_: while ((*i.borrow()) < (*count.borrow())) {
139-
let rhs_0 =
140-
(*total.borrow()).wrapping_add(((*data.borrow())[(*i.borrow()) as usize] as usize));
141-
(*total.borrow_mut()) = rhs_0;
145+
{
146+
let rhs_0 =
147+
(*total.borrow()).wrapping_add(((*data.borrow())[(*i.borrow()) as usize] as usize));
148+
(*total.borrow_mut()) = rhs_0
149+
};
142150
(*i.borrow_mut()).postfix_inc();
143151
}
144152
assert!(((*total.borrow()) == 56_usize));

0 commit comments

Comments
 (0)