()
| 2140 | /// Unsigned less-than comparison via IR: 2 < 5 must be true with `Ult`. |
| 2141 | #[test] |
| 2142 | fn ir_cmp_ult() { |
| 2143 | let i32_ty = IrType::Integer(IntWidth::I32); |
| 2144 | let mut entry = IrBlock::new("entry"); |
| 2145 | entry.push_instruction(IrInstruction::Cmp { |
| 2146 | dest: IrRegister::Named("ok".into()), |
| 2147 | op: IrCmpOp::Ult, |
| 2148 | ty: i32_ty, |
| 2149 | lhs: IrValue::Integer(2), |
| 2150 | rhs: IrValue::Integer(5), |
| 2151 | }); |
| 2152 | let program = pass_fail_ir( |
| 2153 | "ult", |
| 2154 | entry, |
| 2155 | IrValue::Register(IrRegister::Named("ok".into())), |
| 2156 | ); |
| 2157 | let (_, outcome, _) = run_ir(&program); |
| 2158 | assert!( |
| 2159 | matches!(outcome, StepOutcome::Halted(0)), |
| 2160 | "ult: 2 < 5 should be true, got {outcome:?}" |
| 2161 | ); |
| 2162 | } |
| 2163 | |
| 2164 | /// Signed less-than comparison via IR: -1 < 0 must be true with `Slt`. |
| 2165 | #[test] |
nothing calls this directly
no test coverage detected