| 2356 | ); |
| 2357 | let (_, outcome, _) = run_ir(&program); |
| 2358 | assert!( |
| 2359 | matches!(outcome, RunOutcome::Halted(0)), |
| 2360 | "ult: 2 < 5 should be true, got {outcome:?}" |
| 2361 | ); |
| 2362 | } |
| 2363 | |
| 2364 | /// Signed less-than comparison via IR: -1 < 0 must be true with `Slt`. |
| 2365 | #[test] |
| 2366 | fn ir_cmp_slt_negative() { |
| 2367 | let i32_ty = IrType::Integer(IntWidth::I32); |
| 2368 | let mut entry = IrBlock::new("entry"); |
| 2369 | entry.push_instruction(IrInstruction::Cmp { |
| 2370 | dest: IrRegister::Named("ok".into()), |
| 2371 | op: IrCmpOp::Slt, |
| 2372 | ty: i32_ty, |
| 2373 | lhs: IrValue::Integer(-1), |
| 2374 | rhs: IrValue::Integer(0), |
| 2375 | }); |
| 2376 | let program = pass_fail_ir( |
| 2377 | "slt", |
| 2378 | entry, |