Skip to content

Commit 9ae5f7a

Browse files
committed
c2rust-refactor: tests: add test_cast_i32_u32_ssize
1 parent a816b93 commit 9ae5f7a

File tree

1 file changed

+12
-0
lines changed
  • c2rust-refactor/src/transform/casts

1 file changed

+12
-0
lines changed

c2rust-refactor/src/transform/casts/tests.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ fn cast_tys<'bv>(bv: BV<'bv>, tys: &[SimpleTy], pw: PointerWidth) -> BV<'bv> {
6363
thread_local!(static Z3_CONFIG: Config = { let mut c = Config::new(); c.set_model_generation(true); c });
6464
thread_local!(static Z3_CONTEXT: Context = Z3_CONFIG.with(|cfg| Context::new(cfg)));
6565

66+
#[test]
67+
fn test_cast_i32_u32_ssize() {
68+
verify_double_cast(
69+
PointerWidth(64),
70+
vec![
71+
SimpleTy::Int(32, true),
72+
SimpleTy::Int(32, false),
73+
SimpleTy::Size(true),
74+
],
75+
);
76+
}
77+
6678
// Verify `check_double_cast` using Z3
6779
fn verify_double_cast(pw: PointerWidth, tys: Vec<SimpleTy>) -> bool {
6880
if tys.len() <= 1 {

0 commit comments

Comments
 (0)