Skip to content

Commit 0507bc4

Browse files
committed
Update tests
1 parent 2f4b19c commit 0507bc4

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ pub fn operator_comma_0(a: Ptr<S>, b: Ptr<S>) -> S {
1717
v: ({ (a.with(|__s| __s.v) * 10) } + { b.with(|__s| __s.v) }),
1818
};
1919
}
20+
pub fn operator_literal__k_1(mut v: u64) -> i64 {
21+
return (((v).wrapping_mul(1000_u64)) as i64);
22+
}
23+
pub fn operator_literal__half_2(mut v: f64) -> f64 {
24+
return (v / 2_f64);
25+
}
2026
pub fn main() {
2127
__cpp2rust_init_globals();
2228
std::process::exit(main_0());
@@ -48,6 +54,9 @@ fn main_0() -> i32 {
4854
.v
4955
} == 343)
5056
);
57+
assert!((({ operator_literal__k_1(2_u64,) }) == 2000_i64));
58+
assert!((({ operator_literal__half_2(3.0E+0,) }) == 1.5E+0));
59+
assert!((({ operator_literal__k_1(4_u64,) }) == 4000_i64));
5160
return 0;
5261
}
5362
pub fn __cpp2rust_init_globals() {}

‎tests/unit/out/unsafe/operator_other_free.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ pub unsafe fn operator_comma_0(a: *const S, b: *const S) -> S {
1616
v: ((((*a).v) * (10)) + ((*b).v)),
1717
};
1818
}
19+
pub unsafe fn operator_literal__k_1(mut v: u64) -> i64 {
20+
return (((v).wrapping_mul(1000_u64)) as i64);
21+
}
22+
pub unsafe fn operator_literal__half_2(mut v: f64) -> f64 {
23+
return ((v) / (2_f64));
24+
}
1925
pub fn main() {
2026
unsafe {
2127
__cpp2rust_init_globals();
@@ -43,6 +49,9 @@ unsafe fn main_0() -> i32 {
4349
})
4450
.v) == (343))
4551
);
52+
assert!(((unsafe { operator_literal__k_1(2_u64,) }) == (2000_i64)));
53+
assert!(((unsafe { operator_literal__half_2(3.0E+0,) }) == (1.5E+0)));
54+
assert!(((unsafe { operator_literal__k_1(4_u64,) }) == (4000_i64)));
4655
return 0;
4756
}
4857
pub unsafe fn __cpp2rust_init_globals() {}

0 commit comments

Comments
 (0)