Skip to content

Commit

Permalink
Strengthen short operand tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vext01 committed Jan 9, 2024
1 parent 81e1b4b commit 26790c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ykrt/src/compile/jitc_yk/jit_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,16 @@ mod tests {
#[test]
fn does_fit_short_operand() {
for i in 0..SHORT_OPERAND_VALUE_SIZE {
Operand::new(OpKind::Local, 1 << i);
matches!(Operand::new(OpKind::Local, 1 << i), Operand::Short(_));
}
}

#[test]
#[should_panic]
#[should_panic] // Once long operands are implemented, remove.
fn doesnt_fit_short_operand() {
Operand::new(OpKind::Local, 1 << SHORT_OPERAND_VALUE_SIZE);
matches!(
Operand::new(OpKind::Local, 1 << SHORT_OPERAND_VALUE_SIZE),
Operand::Long(_)
);
}
}

0 comments on commit 26790c5

Please sign in to comment.