| 738 | |
| 739 | #[test] |
| 740 | fn test_shift_and_slt() { |
| 741 | let reg = pcode::VarNode::new(1, 1); |
| 742 | |
| 743 | let mut block = pcode::Block::new(); |
| 744 | let tmp = block.alloc_tmp(4); |
| 745 | block.push((tmp, pcode::Op::Load(0), 0x1000)); |
| 746 | |
| 747 | // Common pattern on THUMB is to check a particular bit by shifting it to the sign-bit and |
| 748 | // checking if the value is less than zero. |
| 749 | block.push((tmp, pcode::Op::IntLeft, tmp, 21)); |
| 750 | block.push((reg, pcode::Op::IntSignedLess, (tmp, 0))); |
| 751 | |
| 752 | check(block, 0, Some((10, 10))); |
| 753 | } |
| 754 | |
| 755 | #[test] |
| 756 | fn test_branch() { |